Last active
December 12, 2023 04:51
-
-
Save silvasur/227c01524ffa5eeff74032d95fff8cc5 to your computer and use it in GitHub Desktop.
Userscript to hide Wikipedia donation nagscreen
This file contains 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 Hide wikipedia donation nagscreen | |
// @description Wikimedia, I already give you money, leave me alone! | |
// @version 3 | |
// @grant GM.setValue | |
// @grant GM.getValue | |
// @match https://*.wikipedia.org/* | |
// ==/UserScript== | |
(async function() { | |
console.log("hello") | |
var styles = ` | |
.cn-fundraising, .cn-frthankyou { | |
display: none; | |
} | |
#mw-page-base { | |
padding-top: 0 !important; | |
} | |
#mw-head { | |
top: 0 !important; | |
} | |
#mw-panel { | |
top: 0 !important; | |
} | |
` | |
let agreed = await GM.getValue("agreed"); | |
console.log(agreed); | |
if (agreed === undefined) { | |
agreed = confirm("This userscript is meant for people who already donate regularly to Wikipedia. Do you donate regularly or promise to do so?") | |
await GM.setValue("agreed", agreed); | |
} | |
if (!agreed) | |
return; | |
document.head.appendChild((function(){ | |
let s = document.createElement("style"); | |
s.innerText = styles; | |
return s; | |
})()); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Had the time ro investigate now, and have changed it from
@include
to@match
.