Hacker News new | ask | show | jobs
by user00012-ab 1148 days ago
I've gotten to the point where if a site displays a popup, I just close the page. If I had the ability to remove that source from all future searches I would.
3 comments

I've got addons (ublock) and a Javascript bookmarklet that removes all fixed elements, it's fairly effective.
What happens to sites where a fixed element is part of the UI? Confirmation modals etc.
Things break? I use a similar bookmarklet, but I only ever use it for reading articles which have zero need for any dynamic features. Give me the text, images, and get out of my way.
This sounds great! Can you share the code?
NTHNer but here is the one I use. It's old but it still works a treat: https://alisdair.mcdiarmid.org/kill-sticky-headers/

    (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]);
        }
      }
    })();
I rewrote this to be a little more succinct:

    document.querySelectorAll('body *').forEach(tag =>
      getComputedStyle(tag).position === 'fixed' && tag.remove()
    );
- you can use `forEach()` on the NodeList that `querySelectorAll()` returns

- you can use `remove()` directly on the DOM node you want to remove

Here for an improved version: https://github.com/t-mart/kill-sticky
You can do just that in Kagi. It lets you boost or block sites from search results.
Why not entering a fake email and move on? It's not like many of them do email validation anyways. Something like kgistdaie@gmail.com will do.

At least let them having to handle junk data.

Or the site's own contact email addresses, if you want to be mischievous without potentially spamming an innocent bystander
Good idea. That's what I'm going to use in the future.