If your userscript doesn't have @grant none
you need to use unsafeWindow
instead of window
. Also, it's possible you need to run this code after a small pause using setTimeout
.
Thanks for the hints, I'll try my best!
Hmm couldn't make it work that way. Cookies, obfuscated code, me being a greenhorn...
This may be ugly, but it works now:
Mutation observer for added child nodes (including #overscroll
) which immediately removes them.
// ==UserScript==
// @name Zeit.de remove overscroll
// @namespace graphen
// @version 0.1
// @author Graphen
// @match https://www.zeit.de/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// create instance of observer
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
mutation.addedNodes.forEach(function(node) {
node.remove();
});
});
});
// start observation
observer.observe(document.querySelector(".page__content"), {childList: true} );
})();
Disable overscroll and overlay on zeit.de
I found out it should be those two variables set to false, but can't make it work :-/