user-added Javascript on Links bar: problem with popup blocking

Hi,

I've got some Javascript that opens a new Internet Explorer window. The idea is that the users of my website can add this to a button on their Links bar, to go to my website at any time:

javascript:bmadd=window.open('http://mywebsite.com/blahblah.php url=' + escape(document.location), ...);bmadd.focus();

As you can see it passes the current webpage as an argument, but it always goes to mywebsite.com, which is the desired behaviour. Unfortunately this upsets the IE popup blocker!

On IE6 you could hold down CTRL to override popup blocking, which worked fine, although it was slightly annoying to have to do this. Now I've updated to IE7, the problem is worse: even if I hold down CTRL, or CTRL+ALT as suggested in the IE7 help, I get an error: Internet Explorer cannot download . Unspecified error.

The only workaround I've found is to click once (which brings up the yellow 'Pop-up blocked' message at the top of the screen) and then click a second time, this time holding down CTRL+ALT.

How can I make IE 'trust' my button It doesn't seem unreasonable for a user-added button to open a new window.



Answer this question

user-added Javascript on Links bar: problem with popup blocking

  • darknessangel

    Because I want it to open a new window. :)

    This is central to the purpose of the button. Since the user could be on absolutely any website to begin with, it is crucial that they do not have to navigate away from their current page.

    If it was satisfactory to navigate away from the current page, then I wouldn't have posted the question! ;)


  • Lawrence 007

    Why dont you just have it load in the same window


  • smalamas

    So any ideas how I can make a 'Links' button that brings up a new window without triggering the popup blocker

    Or any workarounds at all


  • user-added Javascript on Links bar: problem with popup blocking