SafariTabs and Pop-Ups
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
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.