Conversaciones » Peticiones de scripts

Disable overscroll and overlay on zeit.de

§
Publicado: 29/7/2018

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
§
Publicado: 29/7/2018
Editado: 29/7/2018

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.

§
Publicado: 29/7/2018

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

§
Publicado: 30/7/2018

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

})();

Publicar respuesta

Inicia sesión para responder.