Chrome extension: how to disable all audio from a specific tab

I was looking for something in the links to the chrome extension to find something that would allow me to control the sound level of the tab. The only option that came to my mind was to make a script so that it went through all the elements on the page and either deleted them or disabled them, if possible.

But I feel that there should be a way to redirect all audio streams to nothing, for example, tear them out of the output, which is the speaker, if you use the html5 audio api ... however, to no avail with the chrome extension apis, nor with the web audio api.

Purpose: turn off all sounds on the page (flash, audio element, etc.)

+2
source share
2 answers

You cannot do it now, although this hopefully will change in the near future.

There is currently nothing in the Chrome API, although in February I proposed the tabaudio API (and now I'm working on a new project, as well as an implementation).

Can you give me an idea of ​​why you want this functionality? (They are asking for potential use in developing APIs.)

Perhaps the closest you can do is something similar to what the MuteTab Chrome extension (written by me, http://www.github.com/jaredsohn/mutetab ) does, which basically crawls the page for objects, paste, audio, video and applet tags and hides them from the page. Unfortunately, this skips web audio. In addition, instead of turning it off, it β€œstops” it by removing it from the page, which can block a video or game related to sound. Also, if you just like HTML5 video or audio with Flash with an API (like YouTube), you can use JavaScript to pause or mute the sound.

+4
source

Now there is a Chrome extension that allows you to disable websites by URL using a blacklist / whitelist called "Disable Tabs by URL ".

This requires that you allow him to read your browsing history, but the description swears that it does not store your URLs anywhere, and the event indicates the location of the source code, so you can check it yourself

+1
source

Source: https://habr.com/ru/post/1011910/


All Articles