Closed Bug 1660687 Opened 4 years ago Closed 4 years ago

BondOpenPGP.jsm is loaded as both a module and a content script

Categories

(MailNews Core :: Security: OpenPGP, defect)

defect

Tracking

(thunderbird_esr78 fixed, thunderbird81 fixed)

RESOLVED FIXED
82 Branch
Tracking Status
thunderbird_esr78 --- fixed
thunderbird81 --- fixed

People

(Reporter: standard8, Assigned: KaiE)

References

Details

(Keywords: memory-footprint, perf)

Attachments

(1 file)

BondOpenPGP.jsm is currently loaded as both a jsm file and a script, e.g.

https://searchfox.org/comm-central/rev/689a37ca900cfb1f45f6b83f1c8e258103ad026e/mail/base/content/messageWindow.xhtml#113
https://searchfox.org/comm-central/rev/689a37ca900cfb1f45f6b83f1c8e258103ad026e/mail/extensions/am-e2e/am-e2e.js#19

This will cause per-window duplication in memory, and the init() function to be run each time a new window is opened.

It could also potentially confused developers that are expecting it to be loaded as a jsm and only one instance created, but then find it is loaded multiple times.

Mark, can you suggest a strategy to fix this?

Flags: needinfo?(standard8)

I'm guessing it's best to remove all src= statements in .xhtml files, and only use import from .js* files.

Assignee: nobody → kaie
Status: NEW → ASSIGNED

Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/fec5c1cd8675
Load BondOpenPGP.jsm as module only, not as content script. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch

Comment on attachment 9172151 [details]
Bug 1660687 - Load BondOpenPGP.jsm as module only, not as content script. r=mkmelin

OpenPGP consistency and correctness. Avoids a risk by potentially duplicating internal data in contexts. Minimal new risk, haven't tested all functional areas, the worst is that some functionality throws an exception instead of working.

Attachment #9172151 - Flags: approval-comm-esr78?

Comment on attachment 9172151 [details]
Bug 1660687 - Load BondOpenPGP.jsm as module only, not as content script. r=mkmelin

Also needed for comm-beta 82

Attachment #9172151 - Flags: approval-comm-beta?

Note when landing to beta, use the patch as given in the commit from comment 4.

Landing on comm-esr78 requires a slightly merged patch which is the version in phabricator.

Comment on attachment 9172151 [details]
Bug 1660687 - Load BondOpenPGP.jsm as module only, not as content script. r=mkmelin

[Triage Comment]
Approved by wsmwk via Matrix on 2020-08-27 for 81.0b2.

Attachment #9172151 - Flags: approval-comm-beta? → approval-comm-beta+

Comment on attachment 9172151 [details]
Bug 1660687 - Load BondOpenPGP.jsm as module only, not as content script. r=mkmelin

[Triage Comment]
Approved for esr78

Attachment #9172151 - Flags: approval-comm-esr78? → approval-comm-esr78+

Unfortunately this change broke the Enigmail migrator. (It fails when clicking the start migration button.)
Confirmed by local backout.

I'm checking if this could be fixed by a change to Enigmail.

Regressions: 1661967

Filed bug 1661967 to track the regression

Flags: needinfo?(standard8)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: