Skip to content

Commit

Permalink
Add an injection blacklist. Addresses #483
Browse files Browse the repository at this point in the history
Fixes Zotero Connector breaking LastPass vault
  • Loading branch information
adomasven committed Jun 21, 2024
1 parent fe3928d commit 5bab058
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/browserExt/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ if (!Zotero.isManifestV3) {
browser.action = browser.browserAction;
}

// Some websites break when injecting translation sandbox iframe into
// the website's first iframe (which we do for websites like ebscohost
// where often the translatable site is not the top frame, but first child frame).
const INJECTION_BLACKLIST = new Set([
'lastpass.com'
])

Zotero.Connector_Browser = new function() {
var _tabInfo = {};
var _incompatibleVersionMessageShown;
Expand Down Expand Up @@ -258,6 +265,10 @@ Zotero.Connector_Browser = new function() {
// Injected via the manifest file
return;
} else {
if (Zotero.isManifestV3) {
const host = new URL(url).host;
if (INJECTION_BLACKLIST.has(host)) return;
}
let tabInfo = this.getTabInfo(tab.id);
if (!tabInfo.frameChecked) {
// Also in the first frame detected
Expand Down

0 comments on commit 5bab058

Please sign in to comment.