-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDelete-Title.user.js
38 lines (33 loc) · 1.27 KB
/
Delete-Title.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// ==UserScript==
// @name Remove HTML Title Tag on Twitch Dashboard
// @author !♥Koͨmͧiͭnͥoͤ Style♥!
// @version 1.0.0
// @description Removes the HTML title tag from the Twitch dashboard and logs a message to the console
// @match https://dashboard.twitch.tv/*
// @grant none
// @license MIT
// @updateURL https://github.com/KominoStyle/Twitch-Delete-Title/raw/main/Delete-Title.user.js
// @downloadURL https://github.com/KominoStyle/Twitch-Delete-Title/raw/main/Delete-Title.user.js
// ==/UserScript==
(function () {
'use strict'
function removeTitleTag() {
var titleTag = document.querySelector('head title')
if (titleTag) {
titleTag.remove()
console.log('%cTitle deleted', 'color: #cc1141')
}
}
window.onload = function () {
removeTitleTag()
const observer = new MutationObserver(function (mutationsList) {
for (const mutation of mutationsList) {
if (mutation.type === 'childList' && mutation.target.nodeName === 'HEAD') {
removeTitleTag()
break
}
}
})
observer.observe(document.documentElement, { childList: true, subtree: true })
}
})()