summaryrefslogtreecommitdiffstats
path: root/dom/base/test/useractivation/file_iframe_check_user_activation.html
blob: 0a3ec734a6da0c9c0334cd208b69bb9bd3effb0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<html>
<head>
  <title>user activated iframe</title>
</head>
<body>
<script>
onload = function() {
  parent.postMessage("loaded", "*");
};
onmessage = function(e) {
  if (e.data === "get") {
    parent.postMessage({
      isActivated: SpecialPowers.wrap(document).hasValidTransientUserGestureActivation,
      hasBeenActivated: SpecialPowers.wrap(document).hasBeenUserGestureActivated,
      lastActivationTimestamp: SpecialPowers.wrap(document).lastUserGestureTimeStamp,
    }, "*");
  }
};
</script>
</body>
</html>