Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: firstRun.js

Issue 8689057: adblockpluschrome: Fix popup origin check when running on adblockplus.org (Closed)
Patch Set: Created Oct. 26, 2012, 9:39 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firstRun.js
===================================================================
--- a/firstRun.js
+++ b/firstRun.js
@@ -3,6 +3,11 @@
var Prefs = require("prefs").Prefs;
var Utils = require("utils").Utils;
+function extractBaseUrl(url)
+{
+ return url.split("/").slice(0, 3).join("/");
+}
+
function openSharePopup(url)
{
var iframe = document.getElementById("share-popup");
@@ -11,7 +16,7 @@
var popupMessageListener = function(event)
{
- if (event.origin !== url)
+ if (event.origin !== extractBaseUrl(url))
Wladimir Palant 2012/10/26 10:45:48 How about new backgroundPage.URI(url).prePath?
return;
iframe.width = event.data.width;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld