diff --git a/toolkit/modules/RemotePageManager.jsm b/toolkit/modules/RemotePageManager.jsm index c601a89cea90..b571b620b4c5 100644 --- a/toolkit/modules/RemotePageManager.jsm +++ b/toolkit/modules/RemotePageManager.jsm @@ -389,7 +389,7 @@ function ChildMessagePort(contentFrame, window) { // Tell the main process to set up its side of the message pipe. this.messageManager.sendAsyncMessage("RemotePage:InitPort", { portID: portID, - url: window.location.toString().replace(/\#.*$/, "") + url: window.document.documentURI.replace(/[\#|\?].*$/, ""), }); } @@ -491,7 +491,7 @@ var registeredURLs = new Set(); var observer = (window) => { // Strip the hash from the URL, because it's not part of the origin. - let url = window.location.toString().replace(/\#.*$/, ""); + let url = window.document.documentURI.replace(/[\#|\?].*$/, ""); if (!registeredURLs.has(url)) return;