Last active
June 12, 2020 20:25
-
-
Save torbiak/4d87868a96ec657986f6122e26ebd502 to your computer and use it in GitHub Desktop.
Revisions
-
torbiak revised this gist
Jun 12, 2020 . 1 changed file with 15 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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. (function () { document.querySelectorAll('*').forEach((e) => { let s = getComputedStyle(e); @@ -23,4 +23,4 @@ e.style.setProperty('overflow', 'visible', 'important'); } }); })(); -
torbiak created this gist
Jun 12, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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'); } }); })();