added script
This commit is contained in:
22
dist/twitch-click-mute.user.js
vendored
Normal file
22
dist/twitch-click-mute.user.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
// ==UserScript==
|
||||||
|
// @name twitch click to mute
|
||||||
|
// @namespace zomo.dev
|
||||||
|
// @match https://www.twitch.tv/*
|
||||||
|
// @version 1.0
|
||||||
|
// @description click to mute/unmute
|
||||||
|
// @downloadURL https://git.zomo.dev/zomo/browser-scripts/raw/branch/main/dist/twitch-click-mute.zomo.js
|
||||||
|
// @supportURL https://git.zomo.dev/zomo/browser-scripts/issues
|
||||||
|
// @homepageURL https://git.zomo.dev/zomo/browser-scripts
|
||||||
|
// ==/UserScript==
|
||||||
|
// scripts/twitch-click-mute/main.ts
|
||||||
|
addEventListener("load", () => {
|
||||||
|
document.body.addEventListener("click", (e) => {
|
||||||
|
let target = e.target;
|
||||||
|
if (target && target.getAttribute("data-a-target") === "player-overlay-click-handler") {
|
||||||
|
let video = document.querySelector("video");
|
||||||
|
if (video) {
|
||||||
|
video.muted = !video.muted;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
15
scripts/twitch-click-mute/main.ts
Normal file
15
scripts/twitch-click-mute/main.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
addEventListener('load', () => {
|
||||||
|
document.body.addEventListener('click', e => {
|
||||||
|
let target = e.target as HTMLElement | null
|
||||||
|
if (
|
||||||
|
target &&
|
||||||
|
target.getAttribute('data-a-target') ===
|
||||||
|
'player-overlay-click-handler'
|
||||||
|
) {
|
||||||
|
let video = document.querySelector('video')
|
||||||
|
if (video) {
|
||||||
|
video.muted = !video.muted
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
8
scripts/twitch-click-mute/meta.json
Normal file
8
scripts/twitch-click-mute/meta.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../meta.schema.json",
|
||||||
|
"name": "twitch click to mute",
|
||||||
|
"namespace": "zomo.dev",
|
||||||
|
"match": "https://www.twitch.tv/*",
|
||||||
|
"version": "1.0",
|
||||||
|
"description": "click to mute/unmute"
|
||||||
|
}
|
||||||
13
scripts/twitch-click-mute/tsconfig.json
Normal file
13
scripts/twitch-click-mute/tsconfig.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es2020",
|
||||||
|
"module": "commonjs",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user