Catch BlockingObserver error when reader is closed immediately

https://forums.zotero.org/discussion/125841/cannot-open-a-pdf-file-in-a-new-tab
This commit is contained in:
Abe Jellinek 2025-08-05 11:17:03 -04:00 committed by Dan Stillman
parent 76c0c9d0ce
commit 75ce9f07b7

View file

@ -183,7 +183,13 @@ class ReaderInstance {
return uri.scheme === 'http' || uri.scheme === 'https';
}
});
this._blockingObserver.register(this._iframe);
try {
this._blockingObserver.register(this._iframe);
}
catch {
// Reader was closed before it could be initialized
// No need to log this
}
this._internalReader = this._iframeWindow.wrappedJSObject.createReader(Components.utils.cloneInto({
type: this._type,