Add "Mute Site" functionality to all websites in Google Chrome

Make the "Mute Site" button active on every site you visit in Google Chrome

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Add "Mute Site" functionality to all websites in Google Chrome
// @namespace   Violentmonkey Scripts
// @match       *://*/*
// @grant       none
// @version     1.0
// @author      enbyte
// @description Make the "Mute Site" button active on every site you visit in Google Chrome
// @license     MIT
// ==/UserScript==


// https://www.reddit.com/r/chrome/comments/1de8ukn/right_click_tab_muteunmute_site_greyed_out/
// with swears removed + comments

function toggle_audio() {
	let dummy_audio_element = document.createElement('audio'); // create a sound to be played
	dummy_audio_element.src = 'data:audio/mp3;base64,'; // make it look like an mp3, with no real data
	document.documentElement.appendChild(dummy_audio_element); // add then immediately delete so chrome sees a blank audio mp3 b64 being played
	document.documentElement.removeChild(dummy_audio_element);
}

toggle_audio();