0

I'm trying to get rid of some onclick ads, and (for me) the easiest solution was to redirect the host. To clarify, when I click the website I'm on, it opens a new tab, with a redirect URL (from the host). This then redirects me to an ad. Think of it like Google with their search results- they send you to a redirect URL first.

Anyhow, I redirected the host to "chrome://newtab" and it works fine- no more ads. However, instead of getting ads, I get blank pages open, which is still annoying. I'd like to redirect the host to a website that closes itself when it loads.

From my research, I think that it's not possible to close a tab with JavaScript alone- you'd have to click a link first, which defeats the purpose.

I've tried all sorts of workarounds with window.close, and it still doesn't work. Any ideas?

(I'm using Chrome 56)

mancestr
  • 969
  • 3
  • 13
  • 34
  • `window.close();` works fine in my version of chrome. – DutChen18 Mar 06 '17 at 12:46
  • @DutChen18- That's odd- read [this answer](http://stackoverflow.com/questions/19761241/window-close-and-self-close-do-not-close-the-window-in-chrome). I thought most newer versions of Chrome and FF couldn't do that. – mancestr Mar 06 '17 at 12:49
  • FF doesn't work, chrome does. Maybe my version is outdated. – DutChen18 Mar 06 '17 at 12:53

1 Answers1

0

I tried this out of desperation, but it seems to work in Chrome:

<?php echo "<script>window.close();</script>"; ?>

mancestr
  • 969
  • 3
  • 13
  • 34