-
-
Save silvasur/227c01524ffa5eeff74032d95fff8cc5 to your computer and use it in GitHub Desktop.
// ==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; | |
})()); | |
})(); |
This works great, thanks
Can I request the file extension to be changed to
.user.js
so that tampermonkey picks up the script for automatically installing it when opening the raw?The
@include
can also use a small update to@match
. Should still function as intended with this pattern
Good idea, have change the file name. Also sorry for late reply :/
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
.
Can I request the file extension to be changed to
.user.js
so that tampermonkey picks up the script for automatically installing it when opening the raw?The
@include
can also use a small update to@match
. Should still function as intended with this pattern