mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18:39 +09:00
Bug 1329032 - Extend loadURIWithOptions by a triggeringPrincipal (without an hard e10s)
This commit is contained in:
parent
102550a483
commit
dee826b7ee
10 changed files with 56 additions and 22 deletions
|
|
@ -8,6 +8,7 @@ const { Ci, Cu, Cr } = require("chrome");
|
|||
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const Services = require("Services");
|
||||
const { NetUtil } = require("resource://gre/modules/NetUtil.jsm");
|
||||
const { Utils } = require("resource://gre/modules/sessionstore/Utils.jsm");
|
||||
|
||||
function readInputStreamToString(stream) {
|
||||
return NetUtil.readInputStreamToString(stream, stream.available());
|
||||
|
|
@ -61,11 +62,11 @@ BrowserElementWebNavigation.prototype = {
|
|||
// No equivalent in the current BrowserElement API
|
||||
this.loadURIWithOptions(uri, flags, referrer,
|
||||
Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT,
|
||||
postData, headers, null);
|
||||
postData, headers, null, null);
|
||||
},
|
||||
|
||||
loadURIWithOptions(uri, flags, referrer, referrerPolicy, postData, headers,
|
||||
baseURI) {
|
||||
baseURI, triggeringPrincipal) {
|
||||
// No equivalent in the current BrowserElement API
|
||||
this._sendMessage("WebNavigation:LoadURI", {
|
||||
uri,
|
||||
|
|
@ -75,6 +76,9 @@ BrowserElementWebNavigation.prototype = {
|
|||
postData: postData ? readInputStreamToString(postData) : null,
|
||||
headers: headers ? readInputStreamToString(headers) : null,
|
||||
baseURI: baseURI ? baseURI.spec : null,
|
||||
triggeringPrincipal: triggeringPrincipal
|
||||
? Utils.serializePrincipal(triggeringPrincipal)
|
||||
: null,
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue