-
Notifications
You must be signed in to change notification settings - Fork 1
/
twitter_content_warning_remover.user.js
51 lines (44 loc) · 1.35 KB
/
twitter_content_warning_remover.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
39
40
41
42
43
44
45
46
47
48
49
50
51
// ==UserScript==
// @name Twitter Content Warning Removal
// @description Remove the retarded content warning shit from media
// @author Kethsar
// @version 1.3
// @match https://twitter.com/*
// @match https://x.com/*
// @inject-into auto
// @updateURL https://raw.githubusercontent.com/Kethsar/twitter_image_links/master/twitter_content_warning_remover.user.js
// @downloadURL https://raw.githubusercontent.com/Kethsar/twitter_image_links/master/twitter_content_warning_remover.user.js
// ==/UserScript==
(function() {
'use strict';
// Liable to break
const contentWarnElement = '.r-yfv4eo + div',
blurClass = '.r-yfv4eo';
let interval = 0;
function init()
{
try
{
interval = setInterval(createThings, 500);
}
catch(e)
{
console.log(e);
}
}
function createThings()
{
if (document.readyState != "complete")
return;
clearInterval(interval);
createStyle();
console.log("Content Warning Remover loaded");
}
function createStyle()
{
const css = document.createElement("style");
css.innerHTML = `${blurClass} { filter: none !important; } ${contentWarnElement} { display: none !important; }`;
document.head.appendChild(css);
}
init();
})();