Open Bug 1862320 Opened 2 years ago Updated 2 years ago

Invisible code in Console after tab detach (Web Developer Tools)

Categories

(DevTools :: Console, defect, P3)

Firefox 121
defect

Tracking

(Not tracked)

UNCONFIRMED

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.

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.

Component: Untriaged → Console
Product: Firefox → DevTools

Thank you for the report!

I can reproduce the bug using the following STRs on Win 11

  1. Load google.com
  2. Open DevTools select the console panel
  3. Type let i=0 and execute
  4. Detach the entire browser tab into a new browser window
  5. DevTools Toolbox is closed, reopen and select the Console panel
  6. The expression from step #3 is not displayed in the Console panel
  7. Type let i=0 and execute again, there is an error Uncaught 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?

Severity: -- → S3
Flags: needinfo?(poirot.alex)
Priority: -- → P3

(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

  1. Load google.com
  2. Open DevTools select the console panel
  3. Type let i=0 and execute
  4. Detach the entire browser tab into a new browser window
  5. DevTools Toolbox is closed, reopen and select the Console panel
  6. The expression from step #3 is not displayed in the Console panel
  7. Type let i=0 and execute again, there is an error Uncaught 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?

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

David, can you tell us what you are expecting more precisely?

Flags: needinfo?(alt.fq-fm63iay)

Expected results:

Code in Console should be preserved when tab is moved around, or
Code should be purged completely not visually only

Flags: needinfo?(alt.fq-fm63iay)
You need to log in before you can comment on or make changes to this bug.