Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Oh, I've never experienced it, because I'm one of those new-tab spammers. That's baffling, but I shield myself from this already. I think I open even more stuff in a new tab, because for years now, one can't count on a correct behavior of the back button. I would like a browser to just restore fully the state of the page as it was, without firing any events whatsoever.

Hmm. I wonder if it is possible to create an extension that accomplished that with a brute force approach, by doing the following:

+ If a link is going to another domain, open it in a new tab, and hide the current tab without closing it.

+ Clicking the back button closes the new tab and unhides the original tab.

That ought to sidestep the effort needed to preserve and restore the state of the original page (which I've found unreliable), by only manipulating it's visibility.

Of course, hiding/revealing a single tab with an extension may not be possible, a cursory search doesn't give much encouragement (I suppose there are too many ways to abuse such an API). A workaround might be moving the tab to a hidden window (which is, now that I think of it, a common pattern for intrusive advertising) and back, instead.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: