-
Notifications
You must be signed in to change notification settings - Fork 46.4k
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]: App not recognized in Firefox, but works in Chrome #26860
Comments
@Azeirah: We're sorry you've seen this error. ❤️ It looks like you forgot to specify a valid URL. (This means that we will not be able to reproduce the problem you're reporting.) Please help us by providing a link to a CodeSandbox (https://codesandbox.io/s/new), a repository on GitHub, or a minimal code example that reproduces the problem. (Screenshots or videos can also be helpful if they help provide context on how to repro the bug.) Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve Issues without repros are automatically closed but we will re-open if you update with repro info. |
Hey @Azeirah, thanks for reporting this. Can you please specify the version of the extension you are using in Firefox? |
It's version 4.27.8 |
I cannot reproduce it with Firefox both v113.0.2 and v104.0, so its probably something wrong on your end. If you can share more about your setup, I can try to help you with fixing that. |
I'm running a React webapp served by apache2. Without sharing sensitive code, this is how the app is initialized const container = document.getElementById("root");
const root = createRoot(container);
root.render(
// <React.StrictMode>
<Provider store={store}>
<LiveInterface />
<App
themeMode={"light"}
theme={{
typography: { fontSize: 32 },
}}
>
<SessionState />
<ErrorBoundary>
<Restart />
<Router />
</ErrorBoundary>
</App>
</Provider>
// </React.StrictMode>
); Package.json ...
"react": "^18.2.0",
... I followed the troubleshooting steps
Another odd thing I noticed is that one page of the same application does work (different react application on the same http server). So
I followed the trace in the firefox debugger: It looks like I would like to note again that it does work in incognito mode. This is on a different computer, same setup and same app. |
Do I understand correctly that it works for you in Firefox's incognito mode? This is strange, because we don't support it yet. |
I thought so, but it's not the case. The plugin gives the notification that it can find react on the page, but the actual devtools don't load. This is in Firefox incognito mode. I'm also noticing that the devtools not loading seems almost random, on some page reloads they do load and on others they don't. This gives me the feeling that there might be a race condition due to script loading order? If the plugin loads before React on the page, it works, if not, it won't. |
Too many factors that might influence it, this will be hard to debug without reproducible sample. If problem is still present, I think you can create a repro from this point. We still have different script injection logic for Firefox and not yet migrated to manifests v3 for Firefox, so this might be the reason why it works on Chrome and not on Firefox. |
What do you mean by running it locally? I need a webserver to serve the application. With The application is running on a local webserver, jamezzv2.test is just a hostfile alias for localhost:somePort |
It should work with Sorry I wasn't clear initially, just trying to check if there is a way to create a reproducible setup. |
I recreated the app with file:// with a simple index.html importing the built application. The devtools recognized the application 10 out of the 10 times that I reloaded it. |
Do you have Content-Security-Policy enabled? That will prevent extensions from running on your application in Firefox. |
This is not it ;( it's not enabled |
I found the cause. The application I'm working is meant for different devices, and it turns out it's the simulated user-agent that causes the dev tools not to recognize the application. I've been able to reproduce this in my development profile using Firefox dev edition as well as on Firefox stable edition on a clean profile.
Without the custom user agent it consistently loads as expected. |
Yeah, it is because of how we parse user agent. This one fails because we look for Can we close this issue? Seems like an expected behaviour. |
As you stated before, there were 2 different applications, and one of them patches user agent. I don't think this is a common case that should be listed somewhere in troubleshooting list. I agree that we should display different popup with more readable explanation of whats going wrong. In your case, extension was trying to start, assuming that it was a Chromium-based browser and failed at some point. I don't know if you tried this before, but there is a way to debug extension in Firefox, and I think you will see errrors in this window's console. I think the right way to handle this would be:
Anyone interested in picking this up? |
Hey @Azeirah, I've opened a PR with changes that should fix it - #27179. Can you please try downloading and installing a custom build from here to check if it fixes the problem for you?
|
I will get back to you tomorrow when I'm at work. Thanks a lot for looking into it :) |
It's working :) |
Awesome, thanks for helping! |
…n user agent (#27179) Fixes #26911, #26860. Currently, we are parsing user agent string to determine which browser is running the extension. This doesn't work well with custom user agents, and sometimes when user turns on mobile dev mode in Firefox, we stop resolving that this is a Firefox browser, extension starts to use Chrome API's and fails to inject. Changes: Since we are building different extensions for all supported browsers (Chrome, Firefox, Edge), we predefine env variables for browser resolution, which are populated in a build step.
…n user agent (facebook#27179) Fixes facebook#26911, facebook#26860. Currently, we are parsing user agent string to determine which browser is running the extension. This doesn't work well with custom user agents, and sometimes when user turns on mobile dev mode in Firefox, we stop resolving that this is a Firefox browser, extension starts to use Chrome API's and fails to inject. Changes: Since we are building different extensions for all supported browsers (Chrome, Firefox, Edge), we predefine env variables for browser resolution, which are populated in a build step.
Website or app
Repro steps
On both Firefox 103 and 104 the react devtools extension says: "This page doesn't appear to be using React".
On the most recent version of Chrome it's working just fine.
I cannot share the project since it's a private project unfortunately, but I suspect this is a regression introduced with the recent #26765
Especially since the devtools were working perfectly fine until maybe one or two weeks ago.
It does work in incognito mode in Firefox.
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
The text was updated successfully, but these errors were encountered: