4 ms·
For people who would like a more concise source (in ES6 & a bit of functional style): [...document.querySelectorAll("*")].filter(el => getComputedStyle(el)
by pcr910303 7y ago
For people who would like a more concise source (in ES6 & a bit of functional style):
[...document.querySelectorAll("*")].filter(el => getComputedStyle(el).position === "fixed").forEach(el => el.parentNode.removeChild(el));
The code above also works, you can add the URL below to bookmarks.
javascript:[...document.querySelectorAll("*")].filter(el%20=>%20getComputedStyle(el).position%20===%20"fixed").forEach(el%20=>%20el.parentNode.removeChild(el));
Also, for people who uses Safari:
You can add javascript: links to your bookmark by adding any bookmark & changing the URL.
- dezren39 7y agoThanks! That's a lot easier on the eyes! So I did this: javascript:(function()%7B(function () %7Bvar i%2C elements %3D document.querySelectorAll('body *')%3Bfor (i %3D 0%3B i < elements.length%3B i%2B%2B) %7Bif (getComputedStyle(elements%5Bi%5D).position %3D%3D%3D 'fixed' || elements%5Bi%5D.className %3D%3D%3D 'awsui-flashbar') %7Belements%5Bi%5D.parentNode.removeChild(elements%5Bi%5D)%3B%7D%7D%7D)()%7D)() To add the flashbar from AWS to the mix, how would I do that with the streams like this? I'm sure if I hunt a bit I'll figure it out.
- EvilTerran 7y agoSpeaking of "concise", in modern browsers you can replace el.parentNode.removeChild(el) with just el.remove(): https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/r...