Skip to content
NDevTK edited this page Mar 31, 2024 · 13 revisions

Welcome to the AutoPause wiki!

background.js

  • If theirs a play event from the active, last active with media or the mediaPlaying tab or its trusted, Then make the tab top priority and if its audible pause all other media.
  • If theirs a pause event from the mediaPlaying tab send a play message to the last played tab.
  • If a tab is muted and hidden pause.
  • If theirs no message from the content script and a tab is audible there maybe no permission so disable automatic resume.
  • If nopermission mode discard tabs instead of pause including otherTabs (if not ignored)

ContentScript.js

  • Keep track of the tab state as to not send messages repeatably.
  • When theirs a message from the background control the media by changing the playbackRate this works without breaking the autoplay rules.
  • If all media on a tab is paused or the playbackRate is 0 send a pause message to background.
  • If all media on a tab is muted send a message to background.

WindowScript.js

When a HTMLMediaElement gets played and it does not exist in the DOM add it to a hidden head div and remove it on pause.

Security

CSP: "default-src 'none'; script-src 'self'; frame-ancestors 'none'; form-action 'none'; upgrade-insecure-requests; block-all-mixed-content"
All permissions are optional and should always be requested by the user in the options page.

Development builds

https://github.com/NDevTK/AutoPause/actions/workflows/builds.yml

Clone this wiki locally