From 05c6fc746dbf135d87b214d0f741bf533eb16b5b Mon Sep 17 00:00:00 2001 From: Jean-François Rameau Date: Wed, 8 Feb 2006 22:20:02 +0000 Subject: Block popup with NULL url (javascript:window.open() for instance). but MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2006-02-08 Jean-François Rameau * embed/mozilla/EphyBrowser.cpp: (HandleEvent): * src/ephy-tab.c: (popups_manager_add),(popups_manager_show): Block popup with NULL url (javascript:window.open() for instance). but don't show them when unblocking. Bug #155009. --- embed/mozilla/EphyBrowser.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'embed') diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp index b097ec33a..6a97f026a 100644 --- a/embed/mozilla/EphyBrowser.cpp +++ b/embed/mozilla/EphyBrowser.cpp @@ -358,12 +358,15 @@ EphyPopupBlockEventListener::HandleEvent (nsIDOMEvent * aDOMEvent) nsCOMPtr popupWindowURI; popupEvent->GetPopupWindowURI (getter_AddRefs (popupWindowURI)); - NS_ENSURE_TRUE (popupWindowURI, NS_ERROR_FAILURE); - - nsresult rv; + nsEmbedCString popupWindowURIString; - rv = popupWindowURI->GetSpec (popupWindowURIString); - NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE); + nsresult rv; + + if (popupWindowURI) + { + rv = popupWindowURI->GetSpec (popupWindowURIString); + NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE); + } nsEmbedString popupWindowFeatures; rv = popupEvent->GetPopupWindowFeatures (popupWindowFeatures); @@ -386,7 +389,7 @@ EphyPopupBlockEventListener::HandleEvent (nsIDOMEvent * aDOMEvent) #endif g_signal_emit_by_name(mOwner->mEmbed, "ge-popup-blocked", - popupWindowURIString.get(), + popupWindowURI == NULL ? NULL : popupWindowURIString.get(), popupWindowNameString.get(), popupWindowFeaturesString.get()); -- cgit