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; | |
})()); | |
})(); |
Don't worry about reply times, it's nit a high priority issue. If you have more user scripts, making a single repo containing all of them would be a nice idea.
Grease- and Tampermonkey should both pick up raw.*git*.*/**/*user.js
patterns to allow installing them on the fly, and the @match
preference for them is also a fairly recent change. I only suggested it because it still works really well, and it'd be nice to keep it that way for as long as possible
Had the time ro investigate now, and have changed it from @include
to @match
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good idea, have change the file name. Also sorry for late reply :/