summaryrefslogtreecommitdiffstats
path: root/dom/base/test/file_record_orientation.html
blob: ec034a8be800302d10b83acd1a207ec5960eec48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!DOCTYPE html>
<html>
<body>
<script>
var recordedOrientations = [];

screen.orientation.onchange = function() {
  recordedOrientations.push(screen.orientation.type);
};

window.addEventListener("message", function(event) {
  if (event.data == "report") {
    event.source.postMessage(recordedOrientations, "*");
  }
});
</script>