4 ms·
One of my favorite bookmarklets to remove cookie notifications or other obnoxious overlays: javascript:(function(){(function () {var i, elements = document
by RandomBacon 6y ago
One of my favorite bookmarklets to remove cookie notifications or other obnoxious overlays:
javascript:(function(){(function () {var i, elements = document.querySelectorAll('body *');for (i = 0; i < elements.length; i++) {if (getComputedStyle(elements[i]).position === 'fixed') {elements[i].parentNode.removeChild(elements[i]);}}})();document.querySelector('body').style.setProperty('overflow','auto','important'); document.querySelector('html').style.setProperty('overflow','auto','important');})()
- Sir_Substance 6y agoI'd really like to see an addon that just blocks the css overflow attribute. I've only ever seen it used by websites that try to stop people who are blocking their giant modal popups from scrolling. It might be that I'm dumb and can't figure out how to add a ublock/umatrix rule to block it, but I'd love a single purpose addon that just deletes "overflow:hidden" in all cases.
- chadlavi 6y agodocument.querySelectorAll('*').forEach(e => e.style.overflow = 'unset')
- Sir_Substance 6y agoNice, I'll keep that as a bookmarket, saves me rooting around in the inspector!
- chadlavi 6y agoMay also need to add others like e.style.overflowY
- timdorr 6y agoI think you mean position: fixed or sticky? Overflow controls what happens when the contents of a bounding box exceed it's allowed size, which is usually to hide or make the box scrollable.
- barbecue_sauce 6y ago'overflow: hidden' is often used to make the content of a page unscrollable on less technically adept news sites where the content is still present on the page.
- Semaphor 6y agomany sites use overflow hidden on body to disable scrolling until you close the popup
- basch 6y agoNot a straight block, but a super handy extension is BehindTheOverlay. It gives you a consistently placed button that removes overlays. Instead of hunting for an X or cancel or close button, you use your muscle memory and always hit the same place in the Chrome. https://chrome.google.com/webstore/detail/behindtheoverlay/ljipkdpcjbmhkdjjmbbaggebcednbbme?hl=en https://chrome.google.com/webstore/detail/behindtheoverlay/l... https://addons.mozilla.org/en-US/firefox/addon/behind_the_overlay/ https://addons.mozilla.org/en-US/firefox/addon/behind_the_ov... https://github.com/NicolaeNMV/BehindTheOverlay https://github.com/NicolaeNMV/BehindTheOverlay
- CM30 6y agoNah, doing this would also break things like carousels/slideshows too, as well as menus that slide in from off screen. And while it's rarer than those, I've definitely also seen page components which show a preview of the content until you click on them, then expand to show everything else. Those would break as well. So while you'd certainly block modal popups that prevent scrolling, you'd also break a bunch of things on other sites that use the overflow property for more legitimate reasons.
- Sir_Substance 6y agoI prefer carousels and slideshows "broken", so I can use my browsers fast built in scroll rather than the visible slow javascript one. This falls under the category of "stop fucking with my scrollbar", a message I wish I could write on enough cakes to send one to every webdev on the planet. The slide out menus would be a shame, but I'd give that up to prevent it's rampant abuse everywhere else.
- Aissen 6y agoIt does not work with Techcrunch, or yahoo/Oath websites, which just do this at the HTTP level.
- timdorr 6y agoThis is run in your browser after the page content downloads and renders. It doesn't matter what tricks the server does.
- Aissen 6y agoThe page does not contain the content. If you don't have the proper cookie, it redirects to a separate consent page; it looks like it's a popup, but the page has no content. It does not matter how much you massage the DOM or CSS: there's nothing below the "popup".
- timdorr 6y agoAh, I see what you mean. Yeah, that wouldn't apply here. It's likely that simply setting a particular cookie with a dummy value would bypass this.
- kevingadd 6y agoWashington Post's paywall has a fun variant on this where not only does it omit the content, it changes the current URL so you can't reopen it in another browser or share it with someone. It's exciting seeing how creative services will get when they're trying to get you to give away your data and/or money for something you can't see.
- neltnerb 6y agoNot to worry, I had a paid subscription and they still tried to track me constantly with 3rd party cookies on top of being able to track me from being logged in (and paying over a hundred dollars a year for the privilege). Just use NPR and donate the amount you'd willingly pay for the paper to your local station.
- chadlavi 6y agoDeleting everything with position: fixed is bad idea jeans!
- wtallis 6y agoNo, it's not. The vast majority of sites that use it are putting bars across the whole screen to permanently display something that really doesn't need to stick around the whole time I'm trying to read the real content.
- deleted 6y ago[deleted]
- joosters 6y agoI've been using a similar bookmarklet for years now, and I have never seen any 'proper' content deleted by it. The fixed elements of a webpage are overwhelmingly likely to be useless and annoying wastes of space.
- layoutIfNeeded 6y agoTell me a legitimate use-case for position:fixed on a website. Not a web app, a web site.
- jrochkind1 6y agoHow does your blocker know which URLs you are visiting are "web apps" and which are "web sites"? I don't know which this is (or where the line is), but here's my latest project at my day job, where we used `position: sticky` for a sort of control bar, that I think worked out fairly well. (There are still some UI issues, but I think fewer than most of our peers trying to implement similar functionality). https://digital.sciencehistory.org/works/4j03d097t https://digital.sciencehistory.org/works/4j03d097t Switch to "transcript" tag, scroll around, click on timecodes to listen to that part of recording, etc.