summaryrefslogtreecommitdiffstats
path: root/dom/base/test/file_record_orientation.html
blob: a01587507bc3332cdfe6c40fd2101c9e9c3c1a8b (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, "*");
  }
}, false);
</script>