Posts Tagged: safari

2009 category Tags 1 Comment

Safari and window.open – How to do it

There is still some traffic coming in from people who are searching for how to deal with the safari popup blocker. So I thought it might be nice to also tell what you can do about it – as most people want solutions, not backgrounds…

So, here you go:

It’s pretty simple, really. What to do? Well, call window.open() while the popup blocker still allows it, and store a reference to the window object. Then, later, do with it what you want. That is, changing the location in most cases.
read more »

2009 category Tags 2 Comments

Safari and window.open

Safari console screenshot

Safari console screenshot

Update: If you are interested in how to make window.open work you might want to also read the follow-up: Safari and window.open – How to do it

Working on a project these days, I noticed that the only call to window.open in that app did not work in Safari. Looking into it, I found that it was Safari’s popup blocker that wouldn’t let that call succeed.

Usually, I don’t deal with window.open, so that behaviour was new to me, and I asked Mr. Google what he knew on this. Not much, as it turned out out – I found only two interesting notes on it. One was pretty strange and I guess it was more about a Safari 3 beta not returning a window object. The other one proposed the the window.open call had to be within the same function body as the method handling the event. The comments on that post affirmed this suspicion, but I decided to look into it myself.

read more »