Skip to content

Instantly share code, notes, and snippets.

@torbiak
Last active June 12, 2020 20:25
Show Gist options
  • Select an option

  • Save torbiak/4d87868a96ec657986f6122e26ebd502 to your computer and use it in GitHub Desktop.

Select an option

Save torbiak/4d87868a96ec657986f6122e26ebd502 to your computer and use it in GitHub Desktop.

Revisions

  1. torbiak revised this gist Jun 12, 2020. 1 changed file with 15 additions and 15 deletions.
    30 changes: 15 additions & 15 deletions hide_sticky.js
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,17 @@
    # Try to make a webpage readable by hiding any fixed/sticky elements---popups,
    # dickbars, etc---and changing overflow=hidden to visible.
    #
    # Adapted from [here](https://alisdair.mcdiarmid.org/kill-sticky-headers/).
    #
    # I like to use this as a bookmarklet bound to a keyword. To create a
    # bookmarklet, use the below code as the url for a bookmark, prefixed by
    # `javascript:`.

    # Go over all elements and hide any fixed/sticky ones in multiple ways so that
    # they're less likely to get re-displayed.
    #
    # Also, set overflow to visible since scrolling is often in concert with
    # showing popups disabled by setting overflow to hidden.
    // Try to make a webpage readable by hiding any fixed/sticky elements---popups,
    // dickbars, etc---and changing overflow=hidden to visible.
    //
    // Adapted from [here](https://alisdair.mcdiarmid.org/kill-sticky-headers/).
    //
    // I like to use this as a bookmarklet bound to a keyword. To create a
    // bookmarklet, use the below code as the url for a bookmark, prefixed by
    // `javascript:`.
    //
    // Go over all elements and hide any fixed/sticky ones in multiple ways so that
    // they're less likely to get re-displayed.
    //
    // Also, set overflow to visible since scrolling is often in concert with
    // showing popups disabled by setting overflow to hidden.
    (function () {
    document.querySelectorAll('*').forEach((e) => {
    let s = getComputedStyle(e);
    @@ -23,4 +23,4 @@
    e.style.setProperty('overflow', 'visible', 'important');
    }
    });
    })();
    })();
  2. torbiak created this gist Jun 12, 2020.
    26 changes: 26 additions & 0 deletions hide_sticky.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    # Try to make a webpage readable by hiding any fixed/sticky elements---popups,
    # dickbars, etc---and changing overflow=hidden to visible.
    #
    # Adapted from [here](https://alisdair.mcdiarmid.org/kill-sticky-headers/).
    #
    # I like to use this as a bookmarklet bound to a keyword. To create a
    # bookmarklet, use the below code as the url for a bookmark, prefixed by
    # `javascript:`.

    # Go over all elements and hide any fixed/sticky ones in multiple ways so that
    # they're less likely to get re-displayed.
    #
    # Also, set overflow to visible since scrolling is often in concert with
    # showing popups disabled by setting overflow to hidden.
    (function () {
    document.querySelectorAll('*').forEach((e) => {
    let s = getComputedStyle(e);
    if (s.position === 'fixed' || s.position === 'sticky') {
    e.style.setProperty('display', 'none', 'important');
    e.style.setProperty('visibility', 'hidden', 'important');
    }
    if (s.overflow === 'hidden') {
    e.style.setProperty('overflow', 'visible', 'important');
    }
    });
    })();