Discussions » Creation Requests

Disable overscroll and overlay on zeit.de

§
Posted: 2018-07-29

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 :-/

window.Zeit.overscrollingActive = false;
window.Zeit.hpOverlay.active = false;
wOxxOmMod
§
Posted: 2018-07-29
Edited: 2018-07-29

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.

§
Posted: 2018-07-29

Thanks for the hints, I'll try my best!

§
Posted: 2018-07-30

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} );

})();

Post reply

Sign in to post a reply.