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