tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

inactive-mediasession.html (580B)


      1 <html>
      2 <head></head>
      3 <script>
      4 const frame = document.createElementNS('http://www.w3.org/1999/xhtml', 'frame');
      5 document.documentElement.appendChild(frame);
      6 
      7 const windowPointer = frame.contentWindow;
      8 document.documentElement.replaceWith();
      9 
     10 // Setting attributes on inactive media session should not cause crash.
     11 windowPointer.navigator.mediaSession.setActionHandler('nexttrack', null);
     12 windowPointer.navigator.mediaSession.playbackState = "playing";
     13 windowPointer.navigator.mediaSession.setPositionState();
     14 windowPointer.navigator.mediaSession.metadata = null;
     15 </script>
     16 </html>