Closed Bug 1679713 Opened 3 years ago Closed 3 years ago

Error when using alert() in compose window editor

Categories

(Thunderbird :: Message Compose Window, defect)

defect

Tracking

(thunderbird_esr78 fixed)

RESOLVED FIXED
87 Branch
Tracking Status
thunderbird_esr78 --- fixed

People

(Reporter: k-l-p, Assigned: rjl)

Details

Attachments

(2 files)

Attached file alert-bug.xpi

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0

Steps to reproduce:

manifest.json:
"compose_action": {
"default_title": "Test",
"default_icon": "test.svg"
},
"permissions": [
"compose",
"activeTab",
"tabs"
]

background.js:
async function klickaktion(tab) {
await browser.tabs.executeScript(tab.id, {
file: "hello.js"
})
}
browser.composeAction.onClicked.addListener(klickaktion);

hello.js:
alert("Hello");

Actual results:

No alert displayed, console shows the error:
TypeError: browser.leaveModalState is not a function PromptParent.jsm:171:17

Expected results:

Alert should be displayed without console error entry.

Confirming, this happens for anything that calls alert in the message composition editor, that it was found by an extension is irrelevant.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Error when using alert() in content script in compose window → Error when using alert() in compose window editor

Fixes alert() and related functions when called from the composition
editor. The browser in that case is <editor> which does not support
enterModalState and leaveModalState.

Assignee: nobody → rob
Status: NEW → ASSIGNED
Attachment #9203606 - Attachment description: Bug 1679713 - Do not call ModalState functions when opening prompts from composition editor. r=darktrojan → Bug 1679713 - Allow composer prompts to open without enterModalState. r=darktrojan
Target Milestone: --- → 87 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/936db9e29968
Allow composer prompts to open without enterModalState. r=darktrojan

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

Comment on attachment 9203606 [details]
Bug 1679713 - Allow composer prompts to open without enterModalState. r=darktrojan

[Approval Request Comment]
Safe bug fix.

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

Comment on attachment 9203606 [details]
Bug 1679713 - Allow composer prompts to open without enterModalState. r=darktrojan

[Triage Comment]
Approved for esr78

Attachment #9203606 - Flags: approval-comm-esr78? → approval-comm-esr78+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: