SafariTabs and Pop-Ups

I've had some great feedback about SafariTabs 0.6, with exception of one thing (or rather annoyance) that seems to be catching peoples attention. And it should because it is very annoying when it occurs. The annoyance I am referring to is the use of pop-ups that hide navigation menus, status bars and resize windows in conjunction with SafariTabs' 'force new window links to open in a new tab'. If you have not already seen it happen then having this option enabled poses some problems as SafariTabs is designed to capture all windows whether they are created using '_blank' as the target or through Javascript which many of them are. SafariTabs captures these calls and creates a tab for them instead of a new window resulting in the user's mian window being resized and the navigation bar being hidden, etc.

This may be a more technical oriented explanation that some people are interested in but I feel that explaining how SafariTabs implements this feature will help improve everyones understanding of the undesired behaviour that is being exhibited. Basically, SafariTabs re-implements Safari's implementation of the WebKit user interface delegate method;

- (WebView *)webView:createWebViewWithRequest:

And simply creates and returns a new WebView within a new tab rather than a new window. Although this works the problem with this delegate method is that the request that is passed along (which is an instance of NSURLRequest) is usually NULL when the call to create a new window is called by Javascript. It turns out this information is passed along to the new WebView later on. OK, so this is not really a big problem, the requested address still loads except that SafariTabs is unable to determine that is was a genuine pop-up that the user really wanted to see with its navigation bar hidden and the window resized. The user did want a new window in this case, not a new tab.

The good news is, is that the method signature of this delegate method has changed in the recent Safari 3.1 beta to the following:

- (WebView *)webView:createWebViewWithRequest:windowFeatures:

This implies that future versions of this method call will provide an NDictionary instance containing the attributes that the new window should posses, that is, is the navigation or status bar hidden and is the window resized, etc. Currently the dictionary is empty but provided it is not in the near future then SafariTabs will be able to determine whether the new window that is requested is indeed one the user would want to see in its own window rather than a tab by comparing its window attributes with the defaults.

Having said this I am working hard to come up with a solution even if the functionality outlined above is not present and the next release of SafariTabs (0.6.1 beta) which is currently in development is aimed at the new Safari 3.1 beta. This release will also include a number of bug fixes and some new minor features that were requested after the release of 0.6.

Posted March 3rd, 2008