Hacker News new | ask | show | jobs
by pwg 2621 days ago
Put this javascript into the URL field of a bookmark (thereby making it a "bookmarklet" [1]) and then select the bookmark [2] on any page that has those sticky elements. Once run, the sticky elements will be gone. Note multi-lines below, but it will all be one line in the URL field.:

    javascript:(function () {                               
      var i,elements=document.querySelectorAll('body *');   
      for (i=0;i<elements.length;i++) {                     
        if (getComputedStyle(elements[i]).position==='fixed' 
            || getComputedStyle(elements[i]).position==='sticky') {
          elements[i].parentNode.removeChild(elements[i]);
        }
      }
    })();
uBlock Origin's custom filters can also be used to delete those sticky elements as well.

[1] https://en.wikipedia.org/wiki/Bookmarklet

[2] on Firefox for Android, 'selecting' the bookmark to run on a page entails touching the URL bar, then selecting the bookmark item into which you placed the javascript from the bookmarks list that will appear.