議論 » 作成依頼

Disable overscroll and overlay on zeit.de

§
投稿日: 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
§
投稿日: 2018/07/29
編集日: 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.

§
投稿日: 2018/07/29

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

§
投稿日: 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} );

})();

返信を投稿

返信を投稿するにはログインしてください。