Browse Source

URL handling changes

pull/2/head
Deathamns 10 years ago
committed by gorhill
parent
commit
c46d25874d
  1. 12
      platform/firefox/frameModule.js

12
platform/firefox/frameModule.js

@ -119,7 +119,7 @@ const contentObserver = {
let openerURL; let openerURL;
if ( location.scheme !== 'http' && location.scheme !== 'https' ) {
if ( !location.schemeIs('http') && !location.schemeIs('https') ) {
if ( type !== this.MAIN_FRAME ) { if ( type !== this.MAIN_FRAME ) {
return this.ACCEPT; return this.ACCEPT;
} }
@ -132,7 +132,7 @@ const contentObserver = {
let isPopup = location.spec === 'about:blank' && openerURL; let isPopup = location.spec === 'about:blank' && openerURL;
if ( location.scheme !== 'data' && !isPopup ) {
if ( !location.schemeIs('data') && !isPopup ) {
return this.ACCEPT; return this.ACCEPT;
} }
} else if ( type === this.MAIN_FRAME ) { } else if ( type === this.MAIN_FRAME ) {
@ -145,8 +145,8 @@ const contentObserver = {
context = (context.ownerDocument || context).defaultView; 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 ) { if ( context.top && context.location ) {
// https://bugzil.la/1092216 // https://bugzil.la/1092216
getMessageManager(context).sendRpcMessage(this.cpMessageName, { getMessageManager(context).sendRpcMessage(this.cpMessageName, {
@ -192,6 +192,10 @@ const contentObserver = {
} }
sandbox._sandboxId_ = sandboxId; 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.sendAsyncMessage = messager.sendAsyncMessage;
sandbox.addMessageListener = function(callback) { sandbox.addMessageListener = function(callback) {
if ( this._messageListener_ ) { if ( this._messageListener_ ) {

Loading…
Cancel
Save