Created
June 11, 2020 07:05
-
-
Save atwayne/e0ea7cf09ca199185f938dad6d6f1e46 to your computer and use it in GitHub Desktop.
tampermonkey user script for douban.fm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name ad blocker for fm.douban.com | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @author Wayne | |
// @match https://fm.douban.com/* | |
// @match https://douban.fm/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const addGlobalCSSRules = function(css) { | |
var head, style; | |
head = document.getElementsByTagName('head')[0]; | |
if (!head) return; | |
style = document.createElement('style'); | |
style.type = 'text/css'; | |
style.innerHTML = css; | |
head.appendChild(style); | |
}; | |
const rules = [ | |
"iframe{display:none !important;}", | |
"a[href='/upgrade']{display:none !important;}" | |
]; | |
const style = rules.join(""); | |
addGlobalCSSRules(style); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment