Closed Bug 1577289 Opened 2 years ago Closed 2 years ago

View Message Source + Save Page As gives: ReferenceError: can't access lexical declaration `SAVEMODE_FILEONLY' before initialization contentAreaUtils.js:1359:5


(Thunderbird :: General, defect)

Not set


(thunderbird_esr6869+ fixed, thunderbird69 wontfix, thunderbird70 fixed)

Thunderbird 70.0
Tracking Status
thunderbird_esr68 69+ fixed
thunderbird69 --- wontfix
thunderbird70 --- fixed


(Reporter: jorgk-bmo, Assigned: aceman)



(1 file, 1 obsolete file)

ReferenceError: can't access lexical declaration `SAVEMODE_FILEONLY' before initialization contentAreaUtils.js:1359:5
GetSaveModeForContentType chrome://global/content/contentAreaUtils.js:1359
internalSave chrome://global/content/contentAreaUtils.js:466
ViewSourceSavePage chrome://messenger/content/viewSource.js:762
oncommand chrome://messenger/content/viewSource.xul:1

Not working in TB 68 :-(

Attached patch 1577289.patch (obsolete) — Splinter Review

This fixes the uninitialized constant.
Now the saving fails with:

Security Error: Content at view-source:mailbox:///xxx/Mail/yyy/Sent?number=1 may not load or link to mailbox:///xxx/Mail/yyy/Sent?number=1.

[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIWebBrowserPersist.savePrivacyAwareURI]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://global/content/contentAreaUtils.js :: internalPersist :: line 666" data: no] contentAreaUtils.js:666:13

Assignee: nobody → acelists

Do we pass a principal at any stage? Then use a system principal. Surely the two schemes don't match: view-source:mailbox and mailbox:

We've seen this error here: bug 1564094 comment #0.

Attached patch 1577289.patch v2Splinter Review

Good idea, passing system principal helped.

Attachment #9088853 - Attachment is obsolete: true
Attachment #9088856 - Flags: review?(jorgk)
Comment on attachment 9088856 [details] [diff] [review]
1577289.patch v2

Thanks. Great you found the optional principal argument.

It works now although the function isn't totally useful, better so just save the message.
Attachment #9088856 - Flags: review?(jorgk)
Attachment #9088856 - Flags: review+
Attachment #9088856 - Flags: approval-comm-esr68+
Attachment #9088856 - Flags: approval-comm-beta+
Target Milestone: --- → Thunderbird 70.0

Pushed by
reorder imports in viewSource.xul to properly initialize SAVEMODE_FILEONLY in contentAreaUtils.js and save the message source using system principal. r=jorgk

Closed: 2 years ago
Resolution: --- → FIXED
Attachment #9088856 - Flags: approval-comm-beta+
You need to log in before you can comment on or make changes to this bug.