22 votes

Tab Muter: re-enables Google Chrome's "Mute Tab" feature

10 comments

  1. [4]
    unknown user
    Link
    For several years, Google Chrome had a feature where you could mute a specific tab by clicking the speaker icon next to the title (it was hidden behind a flag, but many people still used it). This...

    For several years, Google Chrome had a feature where you could mute a specific tab by clicking the speaker icon next to the title (it was hidden behind a flag, but many people still used it). This was removed relatively recently; the justification given by the Chrome team was that:

    • extensions have access to the tab muting APIs, so someone could write an extension to do the same thing, and
    • they wanted to avoid making users manually manage their tabs' audio state.

    A number of people were very unhappy about this, including myself – I was particularly annoyed that they didn't provide an extension to add the feature back like they did with Go Back With Backspace, but since I needed the feature so rarely, I couldn't really be bothered to do anything about it. A couple of days ago, I read a post on reddit where someone was confused as to why they couldn't click the speaker icon any more, and so I finally got around to writing this extension.

    There are many extensions available already that supposedly do the same thing, but most of them aren't open-source or have massive amounts of bloat, and the open-source one I tried got out of sync with the page if you clicked a link. My extension is freely available on GitHub for anyone to use (GPLv3+), and the actual meat of the extension is well under 100 lines of JavaScript, which should hopefully be relatively straightforward to read even if you don't have much programming experience.

    I'd really appreciate any feedback on either the extension itself or the code!

    16 votes
    1. [2]
      Alfred
      Link Parent
      Thanks for making this, you're right, it was really easy to read through, even though I had no experience with Chrome extension development. The only feedback I have is the use of the in operator....

      Thanks for making this, you're right, it was really easy to read through, even though I had no experience with Chrome extension development.

      The only feedback I have is the use of the in operator. here and here

      When testing for the existence of properties on an object you should use Object.prototype.hasOwnProperty because the in operator will look up the prototype chain. So you could get false-positives if google had done something weird with the property names you were looking for.

      2 votes
      1. unknown user
        Link Parent
        Awesome, thanks – I've written almost no JavaScript before, so little bits of knowledge like that are really useful.

        Awesome, thanks – I've written almost no JavaScript before, so little bits of knowledge like that are really useful.

    2. Diff
      Link Parent
      It was hidden behind a flag? I thought this was fairly standard across browsers.

      It was hidden behind a flag? I thought this was fairly standard across browsers.

      1 vote
  2. tomf
    Link
    weird. In Version 70.0.3538.77 (Official Build) (64-bit) (MacOS) chrome://flags I have #enable-tab-audio-muting, which reenables this. For some reason the latest update disabled it.

    weird. In Version 70.0.3538.77 (Official Build) (64-bit) (MacOS) chrome://flags I have #enable-tab-audio-muting, which reenables this. For some reason the latest update disabled it.

    3 votes
  3. quan7hum
    Link
    It's feels so silly to me that they disabled this. I guess it's in line with their trend of making everything as simple and dumbed down as possible, but still. I don't think there are any users...

    It's feels so silly to me that they disabled this. I guess it's in line with their trend of making everything as simple and dumbed down as possible, but still. I don't think there are any users who think removing the option was a good thing.

    I like the way Vivaldi handles this btw. You can choose to play audio on all tabs, only in the active tab or you can prioritize active tab so background tabs only mute when the active tab is playing audio. You can still manually mute/unmute them as well.

    2 votes
  4. [3]
    smores
    Link
    Huh, I just tried adding this to chrome but I'm getting Package is invalid. Details: 'Could not load options page 'options.html'.'. Version 70.0.3538.77 (Official Build) (64-bit) on macOS Mojave

    Huh, I just tried adding this to chrome but I'm getting Package is invalid. Details: 'Could not load options page 'options.html'.'. Version 70.0.3538.77 (Official Build) (64-bit) on macOS Mojave

    1 vote
    1. [2]
      unknown user
      Link Parent
      Oops, I uploaded a new version with options, but apparently forgot to include the options page in the build… Should be fixed now (version 1.1.1), though it might take a little while to roll out....

      Oops, I uploaded a new version with options, but apparently forgot to include the options page in the build… Should be fixed now (version 1.1.1), though it might take a little while to roll out. Thanks for letting me know!

      2 votes
      1. smores
        Link Parent
        Sweet. Thanks so much! This is really great

        Sweet. Thanks so much! This is really great

        1 vote