Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DevTools Bug]: React pages not being detected as using React in Incognito mode #26756

Closed
RichDom2185 opened this issue May 2, 2023 · 6 comments · Fixed by #26765
Closed
Assignees
Labels
Component: Developer Tools Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug Type: Bug

Comments

@RichDom2185
Copy link

Website or app

https://opensource.fb.com

Repro steps

It seems that with the latest update of Chrome and React DevTools, it cannot detect pages as using React on incognito. Screenshot attached below:

image

  • Chrome version: 112.0.5615.137 (arm64)
  • React DevTools version: 4.27.6 (4/20/2023)

How often does this bug happen?

Every time

DevTools package (automated)

No response

DevTools version (automated)

No response

Error message (automated)

No response

Error call stack (automated)

No response

Error component stack (automated)

No response

GitHub query string (automated)

No response

@RichDom2185 RichDom2185 added Component: Developer Tools Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug Type: Bug labels May 2, 2023
@hoxyq hoxyq self-assigned this May 2, 2023
@hoxyq
Copy link
Contributor

hoxyq commented May 2, 2023

Thanks for reporting, looking into this.

Can reproduce with the version 4.27.6 from Chrome web store, but unable to reproduce with a local build.
Something weird happens in incognito mode with registering content scripts for extensions, which are downloaded from store.

@jeremycourtaban
Copy link

Hello,

I have the same bug.

FYI.

OS: Ubuntu 22.04.2 LTS.

Chrome: version 112.0.5615.165 (official build) (64 bits).
React Developer Tools: version 4.27.6 (2023-04-20).
React Developer Tools description: Adds React debugging tools to the Chrome Developer Tools. Created from revision 7f8c501 on 4/20/2023.

Firefox: version 112.0.2 (64 bits).
React Developer Tools: version 4.27.1 (2023-05-01).
React Developer Tools description: Adds React debugging tools to the Firefox Developer Tools. Created from revision 47f63dc on 12/6/2022.

@Baku452
Copy link

Baku452 commented May 2, 2023

Hello. Having the same bug
OS: MacOs Venture 13.3.1 (22E261)
React Dev Tools: version 4.27.6 (4/20/2023)
Chrome: Version 112.0.5615.137 (Official Build) (arm64)

@Costa-iStone
Copy link

Same issue
OS: MacOs Venture 13.3.1
React Dev Tools: version 4.27.6 (4/20/2023)
Chrome: Version 112.0.5615.137 (Official Build) (x86_64)

hoxyq added a commit that referenced this issue May 3, 2023
…istration (#26765)

## Summary
Fixes #26756.

DevTools is failing to inject `__REACT_DEVTOOLS_GLOBAL_HOOK__` hook in
incognito mode. This is not happening straight-forward, but if extension
is toggled on and off, the next time I try to open it I am receiving an
error that content script was already registered.

<img width="676" alt="Screenshot 2023-05-02 at 14 36 53"
src="https://user-images.githubusercontent.com/28902667/235877692-51c5d284-79d9-4b00-b62e-d25d5bb5e056.png">

- Unregistering content scripts before attempting to register them
again. We need to inject `__REACT_DEVTOOLS_GLOBAL_HOOK__` on each page,
so this should be expected behaviour.
- Fixed error logging
 
## How did you test this change?
Local build of extension for Chrome, trying the same steps, which
resulted in an error.
No regression in performance, tested on react.dev, still the same.
@Costa-iStone
Copy link

@hoxyq This is still an issue after code changes. Removed and re-added devtools. Tested Facebook in incognito.
OS: MacOs Venture 13.3.1
React Dev Tools: version 4.27.6 (4/20/2023)
Chrome: Version 112.0.5615.137 (Official Build) (x86_64)

@hoxyq
Copy link
Contributor

hoxyq commented May 4, 2023

@hoxyq This is still an issue after code changes. Removed and re-added devtools. Tested Facebook in incognito. OS: MacOs Venture 13.3.1 React Dev Tools: version 4.27.6 (4/20/2023) Chrome: Version 112.0.5615.137 (Official Build) (x86_64)

The version, which contains this fix is not published yet. I will do a new release this week, so you should expect it to be available in Chrome web store next week. Sorry for any inconvenience caused.

EdisonVan pushed a commit to EdisonVan/react that referenced this issue Apr 15, 2024
…istration (facebook#26765)

## Summary
Fixes facebook#26756.

DevTools is failing to inject `__REACT_DEVTOOLS_GLOBAL_HOOK__` hook in
incognito mode. This is not happening straight-forward, but if extension
is toggled on and off, the next time I try to open it I am receiving an
error that content script was already registered.

<img width="676" alt="Screenshot 2023-05-02 at 14 36 53"
src="https://user-images.githubusercontent.com/28902667/235877692-51c5d284-79d9-4b00-b62e-d25d5bb5e056.png">

- Unregistering content scripts before attempting to register them
again. We need to inject `__REACT_DEVTOOLS_GLOBAL_HOOK__` on each page,
so this should be expected behaviour.
- Fixed error logging
 
## How did you test this change?
Local build of extension for Chrome, trying the same steps, which
resulted in an error.
No regression in performance, tested on react.dev, still the same.
bigfootjon pushed a commit that referenced this issue Apr 18, 2024
…istration (#26765)

## Summary
Fixes #26756.

DevTools is failing to inject `__REACT_DEVTOOLS_GLOBAL_HOOK__` hook in
incognito mode. This is not happening straight-forward, but if extension
is toggled on and off, the next time I try to open it I am receiving an
error that content script was already registered.

<img width="676" alt="Screenshot 2023-05-02 at 14 36 53"
src="https://user-images.githubusercontent.com/28902667/235877692-51c5d284-79d9-4b00-b62e-d25d5bb5e056.png">

- Unregistering content scripts before attempting to register them
again. We need to inject `__REACT_DEVTOOLS_GLOBAL_HOOK__` on each page,
so this should be expected behaviour.
- Fixed error logging

## How did you test this change?
Local build of extension for Chrome, trying the same steps, which
resulted in an error.
No regression in performance, tested on react.dev, still the same.

DiffTrain build for commit 8a25302.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Developer Tools Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug Type: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants