fx115: Update loadURI() calls to take nsIURI and remove loadURIWithFlags

https://bugzilla.mozilla.org/show_bug.cgi?id=1810141
https://bugzilla.mozilla.org/show_bug.cgi?id=1444760
This commit is contained in:
Dan Stillman 2023-12-03 04:40:20 -05:00
parent c36f40735c
commit e76c6c6a1a
6 changed files with 12 additions and 8 deletions

View file

@ -92,7 +92,7 @@ var Scaffold = new function () {
browserUrl.addEventListener('keydown', function (e) {
if (e.key == 'Enter') {
Zotero.debug('Scaffold: Loading URL in browser: ' + browserUrl.value);
_browser.loadURI(browserUrl.value, {
_browser.loadURI(Services.io.newURI(browserUrl.value), {
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal()
});
}
@ -1903,7 +1903,7 @@ var Scaffold = new function () {
Zotero.launchURL(url);
}
else {
_browser.loadURI(url, {
_browser.loadURI(Services.io.newURI(url), {
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal()
});
_showTab('browser');

View file

@ -168,7 +168,7 @@ class HiddenBrowser {
oa
)
};
this.loadURI(url, loadURIOptions);
this.loadURI(Services.io.newURI(url), loadURIOptions);
let { webProgress } = this;
let progressListener = {

View file

@ -919,8 +919,12 @@ var Zotero_File_Interface = new function() {
}
browser.addEventListener("pageshow", listener, false);
browser.loadURIWithFlags("data:text/html;charset=utf-8,"+encodeURI(bibliography),
Components.interfaces.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY, null, "utf-8", null);
browser.loadURI(
Services.io.newURI("data:text/html;charset=utf-8," + encodeURI(bibliography)),
{
flags: Components.interfaces.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY
}
);
} else if(io.method == "save-as-html") {
let fStream = await _saveBibliography(name, "HTML");

View file

@ -44,7 +44,7 @@ window.addEventListener("load", () => {
document.title = browser.contentTitle;
});
browser.loadURI(URI, {
browser.loadURI(Services.io.newURI(URI), {
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
});
}, false);

View file

@ -56,7 +56,7 @@ window.addEventListener("load", /*async */function () {
// Get URI and options passed in via openWindow()
let { uri, options } = window.arguments[0].wrappedJSObject;
window.viewerOriginalURI = uri;
loadURI(uri, options);
loadURI(Services.io.newURI(uri), options);
}, false);
window.addEventListener("keypress", function (event) {

View file

@ -806,7 +806,7 @@ class PDFRenderer {
if (this._browser.contentWindow.location.href === 'about:blank') return;
this._browser.contentWindow.addEventListener('message', _handleMessage);
});
this._browser.loadURI(RENDERER_URL);
this._browser.loadURI(Services.io.newURI(RENDERER_URL));
let _handleMessage = async (event) => {
if (event.source !== this._browser.contentWindow) {