Invisible code in Console after tab detach (Web Developer Tools)
Categories
(DevTools :: Console, defect, P3)
Tracking
(Not tracked)
People
(Reporter: alt.fq-fm63iay, Unassigned, NeedInfo)
Details
Steps to reproduce:
press shift + ctrl + I, select Console, type: let i = 0 and run
drag tab to create new FF window
press shift + ctrl + I, select Console, type: let i = 0 and run
Actual results:
Uncaught SyntaxError: redeclaration of let i
<anonymous> debugger eval code:1
debugger eval code:1:1
<anonymous> debugger eval code:1
Expected results:
Code in Console should be preserved then tab is moved around, or
Code should be purged completely not visually only
Tested and observed on current and older version of FF under Linux/Windows.
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::Console' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•2 years ago
|
||
Thank you for the report!
I can reproduce the bug using the following STRs on Win 11
- Load google.com
- Open DevTools select the console panel
- Type
let i=0and execute - Detach the entire browser tab into a new browser window
- DevTools Toolbox is closed, reopen and select the Console panel
- The expression from step #3 is not displayed in the Console panel
- Type
let i=0and execute again, there is an errorUncaught SyntaxError: redeclaration of let i
The Console should preserve the content.
I think that there is a reason why we close the entire DevTools Toolbox and perhaps even a bug for it?
Alex, do you know why?
Comment 3•2 years ago
|
||
(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #2)
Thank you for the report!
I can reproduce the bug using the following STRs on Win 11
- Load google.com
- Open DevTools select the console panel
- Type
let i=0and execute- Detach the entire browser tab into a new browser window
- DevTools Toolbox is closed, reopen and select the Console panel
- The expression from step #3 is not displayed in the Console panel
- Type
let i=0and execute again, there is an errorUncaught SyntaxError: redeclaration of let iThe Console should preserve the content.
I think that there is a reason why we close the entire DevTools Toolbox and perhaps even a bug for it?
Alex, do you know why?
I'm not sure why we need all these steps, 1, 2 and 4 are enough for DevTools to be hidden.
Then for the evaluation, the tab is moved to a new window, but the document stays the same, so anything you declared before is still there (so any variable or anything). So re-assigning a let will throw, but you don't need to move the tab to observe that. We can't just revert the evaluations we did in the console if there was an impact on the page document, so for me that's not a bug. If you want to "reset" the document state, you can reload the page.
Otherwise, we have Bug 1580891 to allow to re-declare let/const
Comment 4•2 years ago
|
||
David, can you tell us what you are expecting more precisely?
Expected results:
Code in Console should be preserved when tab is moved around, or
Code should be purged completely not visually only
Description
•