qutebrowser: Add function to remove floating elements
Primarily used to get rid of cookie banners or 'subscribe-to-my-newsletter' annoyances.
This commit is contained in:
parent
9159ea177d
commit
7003fe992f
3 changed files with 8 additions and 2 deletions
|
|
@ -43,3 +43,6 @@ c.aliases["recent-downloads"] = "spawn --userscript recently-downloaded"
|
|||
|
||||
# annotate with hypothesis
|
||||
c.aliases["hypothesis"] = "jseval (function(){window.hypothesisConfig=function(){return{showHighlights:true,appType:'bookmarklet'};};var d=document,s=d.createElement('script');s.setAttribute('src','https://hypothes.is/embed.js');d.body.appendChild(s)})();'hypothesis enabled'"
|
||||
|
||||
# remove any sticky banners (e.g. cookie banners)
|
||||
c.aliases["remove-floating"] = 'jseval (function(){var i,elements=document.querySelectorAll("body *");for(i=0;i<elements.length;i++){var pos=getComputedStyle(elements[i]).position;if(pos==="fixed"||pos==="sticky"){elements[i].parentNode.removeChild(elements[i]);}}})();'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue