From c46d25874d38b401bc31d7494d0db47e08a995ec Mon Sep 17 00:00:00 2001 From: Deathamns Date: Thu, 15 Jan 2015 13:24:35 +0100 Subject: [PATCH] URL handling changes --- platform/firefox/frameModule.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/platform/firefox/frameModule.js b/platform/firefox/frameModule.js index ae469a0..6f12f18 100644 --- a/platform/firefox/frameModule.js +++ b/platform/firefox/frameModule.js @@ -119,7 +119,7 @@ const contentObserver = { let openerURL; - if ( location.scheme !== 'http' && location.scheme !== 'https' ) { + if ( !location.schemeIs('http') && !location.schemeIs('https') ) { if ( type !== this.MAIN_FRAME ) { return this.ACCEPT; } @@ -132,7 +132,7 @@ const contentObserver = { let isPopup = location.spec === 'about:blank' && openerURL; - if ( location.scheme !== 'data' && !isPopup ) { + if ( !location.schemeIs('data') && !isPopup ) { return this.ACCEPT; } } else if ( type === this.MAIN_FRAME ) { @@ -145,8 +145,8 @@ const contentObserver = { context = (context.ownerDocument || context).defaultView; } - // The context for the popups is an iframe element here, - // so check context.top instead + // The context for the toolbar popup is an iframe element here, + // so check context.top instead of context if ( context.top && context.location ) { // https://bugzil.la/1092216 getMessageManager(context).sendRpcMessage(this.cpMessageName, { @@ -192,6 +192,10 @@ const contentObserver = { } sandbox._sandboxId_ = sandboxId; + sandbox._urlNormalizer_ = function(url, baseURI) { + baseURI = Services.io.newURI(baseURI, null, null); + return Services.io.newURI(url, null, baseURI).asciiSpec; + }; sandbox.sendAsyncMessage = messager.sendAsyncMessage; sandbox.addMessageListener = function(callback) { if ( this._messageListener_ ) {