fx-compat: Load zotero://report/ channels as chrome
It seems that the issue wasn't that zotero:// URLs can't be loaded in a content browser, but rather that the report extension was returning a channel that the content browser couldn't access. For some reason, it handled that failure by passing the URL off to the OS, which then opened a duplicate instance of Zotero. Also: - Remove ensureBrowserType() and always use <browser type="content"> in basicViewer (see b8966f) - Fix system principal being used to load extensions without `loadAsChrome` set to true if an extension with `loadAsChrome` set to true had been loaded in the past
This commit is contained in:
parent
6a85dd2c5e
commit
48f7830558
2 changed files with 10 additions and 41 deletions
|
@ -156,7 +156,7 @@ function ZoteroProtocolHandler() {
|
|||
* Report generation extension for Zotero protocol
|
||||
*/
|
||||
var ReportExtension = {
|
||||
loadAsChrome: false,
|
||||
loadAsChrome: true,
|
||||
|
||||
newChannel: function (uri, loadInfo) {
|
||||
return new AsyncChannel(uri, loadInfo, function* () {
|
||||
|
@ -1293,10 +1293,6 @@ ZoteroProtocolHandler.prototype = {
|
|||
return this._getCancelledChannel();
|
||||
}
|
||||
|
||||
if (!this._principal && ext.loadAsChrome) {
|
||||
this._principal = Services.scriptSecurityManager.getSystemPrincipal();
|
||||
}
|
||||
|
||||
var extChannel = ext.newChannel(uri, loadInfo);
|
||||
// Extension returned null, so cancel request
|
||||
if (!extChannel) {
|
||||
|
@ -1304,7 +1300,10 @@ ZoteroProtocolHandler.prototype = {
|
|||
}
|
||||
|
||||
// Apply cached principal to extension channel
|
||||
if (this._principal) {
|
||||
if (ext.loadAsChrome) {
|
||||
if (!this._principal) {
|
||||
this._principal = Services.scriptSecurityManager.getSystemPrincipal();
|
||||
}
|
||||
extChannel.owner = this._principal;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue