From a17aa7d47fa3fd081ef838ccf7e4a16537b4a234 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 3 Feb 2005 10:04:06 +0000 Subject: [project @ 2005-02-03 10:04:06 by jmb] Fix issue with plugins embedded in a page requesting fetch of the same page on load. Add option to block popups. svn path=/import/netsurf/; revision=1482 --- riscos/plugin.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'riscos/plugin.c') diff --git a/riscos/plugin.c b/riscos/plugin.c index 03692c262..828bc0c92 100644 --- a/riscos/plugin.c +++ b/riscos/plugin.c @@ -796,13 +796,22 @@ void plugin_url_access(wimp_message *message) * other window names */ if (!post) { /* GET request */ - if (strcasecmp(window, "_self") == 0 || + if (strcasecmp(url, + c->data.plugin.bw->current_content->url) && + (strcasecmp(window, "_self") == 0 || strcasecmp(window, "_parent") == 0 || strcasecmp(window, "_top") == 0 || - strcasecmp(window, "") == 0) { + strcasecmp(window, "") == 0)) { + /* only open in current window if not + * already at the URL requested, else you + * end up in an infinite loop of fetching + * the same page + */ browser_window_go(c->data.plugin.bw, url, 0); } - else if (strcasecmp(window, "_blank") == 0) { + else if (!option_block_popups && + strcasecmp(window, "_blank") == 0) { + /* don't do this if popups are blocked */ browser_window_create(url, NULL, 0); } } -- cgit v1.2.3