summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extensions/requestpolicy5
-rw-r--r--src/plugins.c4
2 files changed, 6 insertions, 3 deletions
diff --git a/extensions/requestpolicy b/extensions/requestpolicy
index a5ab0236..44455c8d 100644
--- a/extensions/requestpolicy
+++ b/extensions/requestpolicy
@@ -366,7 +366,10 @@ var resourceCB = (function ()
if (!message)
return false;
- firstParty = util.domainFromHost(message.firstParty.host);
+ if (message.firstParty)
+ firstParty = util.domainFromHost(message.firstParty.host);
+ else
+ firstParty = wv.mainFrame.domain;
domain = util.domainFromHost(message.uri.host);
if (firstParty == domain)
return false;
diff --git a/src/plugins.c b/src/plugins.c
index 10f98f83..3dcef247 100644
--- a/src/plugins.c
+++ b/src/plugins.c
@@ -95,9 +95,9 @@ plugins_create_click_element(WebKitDOMElement *element, GList *gl)
char *left = webkit_dom_css_style_declaration_get_property_value(style, "left");
char *position = webkit_dom_css_style_declaration_get_property_value(style, "position");
int w, h;
- if (sscanf(width, "%dpx", &w) == 1 && w<72)
+ if (*width == '\0' || (sscanf(width, "%dpx", &w) == 1 && w<72))
w = 72;
- if (sscanf(height, "%dpx", &h) == 1 && h<24)
+ if (*height == '\0' || (sscanf(height, "%dpx", &h) == 1 && h<24))
h = 24;