tabs.executeScript() does not work for a tab in a popup type window
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(thunderbird_esr78 fixed, thunderbird80 fixed)
People
(Reporter: yuki, Assigned: darktrojan)
Details
Attachments
(2 files)
|
1.00 KB,
application/x-xpinstall
|
Details | |
|
47 bytes,
text/x-phabricator-request
|
wsmwk
:
approval-comm-beta+
wsmwk
:
approval-comm-esr78+
|
Details | Review |
The API tabs.executeScript() does not execute given script for a tab in a popup type window. Popup type window is only one way to implement modal-like dialog by an addon, and this restriction makes it a little hard for me to control such dialogs.
Steps to reproduce
- Install the attached testcase addon.
- Switch to any mail tab, then you can see a new toolbar button named "testcase".
- Click the "testcase" toolbar button.
- A popup window is opened with no UI (except default window controls).
- Wait about 3 sec.
Actual result
Nothing happens in the popup window.
Expected result
After 3 sec it starts counting up in the popup window.
Environment
- Windows 10 1909
- Daily 80.0a1 Build ID: 20200712123207
- Thunderbird 78.0b4 Build ID: 20200629202523
| Reporter | ||
Comment 1•11 months ago
•
|
||
This problem doesn't happen on Firefox.
On my environment, tabs.executeScript raises an error in the debugger console for the testcase addon:
can't access property "innerWindowID", browser is null ext-tabs.js:70
awaitTabReady chrome://messenger/content/parent/ext-tabs.js:70
promiseTabWhenReady chrome://messenger/content/parent/ext-tabs.js:272
executeScript chrome://messenger/content/parent/ext-tabs.js:538
executeScript self-hosted:935
result resource://gre/modules/ExtensionParent.jsm:930
withPendingBrowser resource://gre/modules/ExtensionParent.jsm:485
result resource://gre/modules/ExtensionParent.jsm:930
callAndLog resource://gre/modules/ExtensionParent.jsm:892
recvAPICall resource://gre/modules/ExtensionParent.jsm:929
AsyncFunctionNext self-hosted:684
The error is raised from https://searchfox.org/comm-central/rev/1598a3b8368c0b823505889ddd1c57f398fded5f/mail/components/extensions/parent/ext-tabs.js#67
awaitTabReady(nativeTabInfo) {
let deferred = this.tabReadyPromises.get(nativeTabInfo);
if (!deferred) {
deferred = PromiseUtils.defer();
let browser = getTabBrowser(nativeTabInfo); <= HERE!
The function getTabBrowser() looks to return null on Thunderbird.
Tb tabs do not behave like Fx tabs, see bug 1649035. For one, a <browser> is not guaranteed.
| Assignee | ||
Updated•10 months ago
|
| Assignee | ||
Comment 3•10 months ago
|
||
| Assignee | ||
Comment 4•10 months ago
|
||
I have grand plans to expand this test to cover all of the valid tab types, but currently I'm too busy to do it. What I have done so far might as well land and get on the road to 78.2.
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/4d64ac57fa70
Fix execution of content scripts in external popup windows. r=mkmelin DONTBUILD
Updated•10 months ago
|
Updated•10 months ago
|
Comment 6•10 months ago
|
||
(In reply to Geoff Lankow (:darktrojan) from comment #4)
I have grand plans to expand this test to cover all of the valid tab types, but currently I'm too busy to do it. What I have done so far might as well land and get on the road to 78.2.
And how do you intend this to happen without beta and ESR approval requests? This is one of currently 14 bugs lacking such request.
Comment 7•10 months ago
|
||
This just landed. We can take care of approvals once a bug has exposure on nightly. Did you notice there's a "Testing completed (on c-c, etc.): " question in the approval form?
Comment 8•10 months ago
|
||
Fact is that requests are just forgotten, see discussion on tb-drivers. You even missed things that ought to be on the way to TB 78.1.x which missed the current beta.
| Assignee | ||
Comment 9•10 months ago
|
||
Comment on attachment 9166982 [details]
Bug 1652478 - Fix execution of content scripts in external popup windows. r?mkmelin
[Approval Request Comment]
Extensions will be hamstrung without this. Any risk is restricted to extensions.
Comment 10•10 months ago
|
||
Comment on attachment 9166982 [details]
Bug 1652478 - Fix execution of content scripts in external popup windows. r?mkmelin
[Triage Comment]
Approved for beta
Comment 11•10 months ago
|
||
| bugherderuplift | ||
Thunderbird 80.0b2:
https://hg.mozilla.org/releases/comm-beta/rev/b83bc1a89133
Updated•10 months ago
|
| Assignee | ||
Updated•10 months ago
|
Comment 12•10 months ago
|
||
Comment on attachment 9166982 [details]
Bug 1652478 - Fix execution of content scripts in external popup windows. r?mkmelin
[Triage Comment]
Approved for esr78
| Assignee | ||
Comment 13•10 months ago
|
||
| bugherderuplift | ||
Thunderbird 78.2.0:
https://hg.mozilla.org/releases/comm-esr78/rev/ef7408c62aeb
Description
•