diff --git a/camino/src/browser/BrowserWindowController.mm b/camino/src/browser/BrowserWindowController.mm index ab13df268812..ba92d0e6eccd 100644 --- a/camino/src/browser/BrowserWindowController.mm +++ b/camino/src/browser/BrowserWindowController.mm @@ -1945,11 +1945,19 @@ enum BWCOpenDest { popupWindowURI->GetSpec(uriStr); // whitelist the URL - [self whitelistURL:requestingWindowURI]; - + nsCOMPtr requestingWindowURI; + nsCOMPtr webNav = do_GetInterface(requestingWindow); + if (webNav) + webNav->GetCurrentURI(getter_AddRefs(requestingWindowURI)); + + if (requestingWindowURI) + [self whitelistURL:requestingWindowURI]; + else + NSLog(@"Couldn't whitelist the URI"); + // show the blocked popup nsCOMPtr openedWindow; - nsresult rv = domWin->Open(NS_ConvertUTF8toUTF16(uriStr), windowName, features, getter_AddRefs(openedWindow)); + nsresult rv = piDomWin->Open(NS_ConvertUTF8toUTF16(uriStr), windowName, features, getter_AddRefs(openedWindow)); if (NS_FAILED(rv)) NSLog(@"Couldn't show the blocked popup window for %@", [NSString stringWith_nsACString:uriStr]); }