aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--embed/mozilla/EphyBrowser.cpp15
-rw-r--r--src/ephy-tab.c17
3 files changed, 28 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 783390770..405f65072 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-02-08 Jean-François Rameau <jframeau@cvs.gnome.org>
+
+ * 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.
+
2006-02-08 Christian Persch <chpe@cvs.gnome.org>
* m4/gecko.m4:
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<nsIURI> 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());
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index 8a95ff477..2fa0c31aa 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -535,7 +535,7 @@ popups_manager_add (EphyTab *tab,
popup = g_new0 (PopupInfo, 1);
- popup->url = g_strdup (url);
+ popup->url = (url == NULL) ? NULL : g_strdup (url);
popup->name = g_strdup (name);
popup->features = g_strdup (features);
@@ -651,14 +651,17 @@ popups_manager_show (PopupInfo *popup,
EphyEmbed *embed;
EphyEmbedSingle *single;
- embed = ephy_tab_get_embed (tab);
-
- single = EPHY_EMBED_SINGLE
- (ephy_embed_shell_get_embed_single (embed_shell));
+ /* Only show popup with non NULL url */
+ if (popup->url != NULL)
+ {
+ embed = ephy_tab_get_embed (tab);
- ephy_embed_single_open_window (single, embed, popup->url,
- popup->name, popup->features);
+ single = EPHY_EMBED_SINGLE
+ (ephy_embed_shell_get_embed_single (embed_shell));
+ ephy_embed_single_open_window (single, embed, popup->url,
+ popup->name, popup->features);
+ }
popups_manager_free_info (popup);
}