Closed Bug 1778951 Opened 2 years ago Closed 2 years ago

Background script console (Toolbox) gets stuck after addon reload

Categories

(DevTools :: about:debugging, defect, P1)

Firefox 103
defect

Tracking

(firefox-esr91 unaffected, firefox-esr102 fixed, firefox103 wontfix, firefox104 fixed)

RESOLVED FIXED
104 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox-esr102 --- fixed
firefox103 --- wontfix
firefox104 --- fixed

People

(Reporter: juraj.masiar, Assigned: jdescottes)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

Attached file broken_console.zip

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

Steps to reproduce:

Using Firefox 102/103/104:

  1. extract extension
  2. load it from "about:debugging" page
  3. inspect background script by clicking the "Inspect" button or by opening: "about:devtools-toolbox?id=bugzilla%40broken.reload&type=extension"
  4. you will see some console logs that should update every 5 seconds
  5. wait 10 seconds

Actual results:

The logs stops updating after 10 seconds (second reload).
Additionally, console is now not working and executing anything inside it won't print any results anymore.

Expected results:

The console should re-print the logs every 5 seconds.

This is a regression, it works in Firefox ESR 91 but not it current version.
This makes addon development very bad because it forces developer to close and reopen background script tab over and over.

Thanks for filing. I assume this is similar to Bug 1773635?

See Also: → 1773635
Status: UNCONFIRMED → NEW
Ever confirmed: true

I can't really tell, title sounds ok but the steps are confusing... I would close that one and keep this.

I was hoping this issue will be fixed by bug 1753048 but my comments there were somehow ignored :(
The steps to reproduce in this bug should be more clear but in general it's the same as steps I wrote in bug 1753048 comment 9.

I still don't understand how are people developing extensions in Firefox these days because this bug breaks completely background script console. I had to migrate to ESR 91 where it still works.

(In reply to juraj.masiar from comment #2)

I can't really tell, title sounds ok but the steps are confusing... I would close that one and keep this.

The STRs here should probably highlight that the extension performs a reload. I can close the other one to avoid duplicated but I think the STRs are still worth mentioning here, because they work with any extension, and don't require to wait for N seconds:

  • load any temporary webextension with a background script with aboutdebugging
  • click on inspect
  • click on reload twice
  • try to use the console

I was hoping this issue will be fixed by bug 1753048 but my comments there were somehow ignored :(

Sorry about that, I focused on the initial report and it turns out the two issues were not related.
The comments were not ignored on purpose but in general filing dedicated bugs is better.

Severity: -- → S2
Priority: -- → P2
Priority: P2 → P1
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Blocks: 1780255
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b0e99edbf072
[devtools] Update webextension target actor browsingcontext group id after addon reload r=rpl,ochameau
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch

Thank you for the fast fix!
I've just tested it in 104.0a1 (2022-07-19) with web-ext and it works great :), I'm so happy!

Additionally, could it be backported to the new ESR 102?
I would like to stay on ESR channel for addons development.
Thanks again fixing this!

Yes, thank you for the fix and thanks @juraj.masiar for reporting this!

I second the vote to backport it to ESR 102, especially for Thunderbird add-on developers.

Comment on attachment 9285322 [details]
Bug 1778951 - [devtools] Update webextension target actor browsingcontext group id after addon reload

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Without this fix, the Developer Tools for webextensions break after a few reloads of the extension. This is particularly annoying when using webext because the webextension is reloaded automatically. Extension developers need to test against ESR, and this is a regression compared to ESR 91 so we should fix it.
  • User impact if declined: Devtools break on webextension reload
  • Fix Landed on Version: 104
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): javascript-only fix, only impacts devtools users, has automated tests
Attachment #9285322 - Flags: approval-mozilla-esr102?

Thanks for testing, glad it's fixed. I agree let's try to move this to ESR.

Comment on attachment 9285322 [details]
Bug 1778951 - [devtools] Update webextension target actor browsingcontext group id after addon reload

Approved for 102.2esr.

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

Attachment

General

Creator:
Created:
Updated:
Size: