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

Keep track of URL changes #224

Open
craterkamath opened this issue Sep 17, 2020 · 4 comments
Open

Keep track of URL changes #224

craterkamath opened this issue Sep 17, 2020 · 4 comments
Assignees

Comments

@craterkamath
Copy link

We use v8 inspector in our project to debug JS code that is running on our isolates and deliver it as a feature to the users to help them debug their code better. Often times the URL to open the debugger(the devtools inspector) seems to break since the URL format is not consistent across different devtools versions/chrome versions.

From our findings we've made a rough estimate of the URL formats:

  • Chrome Version > 84 : devtools://devtools/bundled/inspector.html?
  • Chrome Version > 83 : devtools://devtools/bundled/js_app.html?
  • Older Versions : chrome-devtools://devtools/bundled/js_app.html?

Can anyone redirect me to a comprehensive guide to these change formats and the exact same release versions of these changes? If there a hack to make these changes forward-compatible by any means? We definitely cannot control the version of the chrome the user is accessing our product with!

@hashseed
Copy link
Contributor

Unfortunately we don't have an expectation on the URL to stay stable. The best way is to go from chrome://inspect.

Maybe you could query Chrome's version and use that to map to the URL?

@craterkamath
Copy link
Author

That is exactly how we are planning to implement it as of now. To explain a bit more -- the server sends a websocket address to the client wherein the user can connect to that socket through the devtools to debug the JS code running on the remote isolate on the server.

i.e The user will get a link of the form devtools://devtools/bundled/inspector.html?ws=xxxxxxxx or chrome-devtools://devtools/bundled/js_app.html?ws=xxxxxx which he can enter in the search bar. As of now, this dynamic URL generation is based on the user-agent and the chrome version and is completely hardcoded.

This poses two problems, firstly the map that we have may not be accurate(I need help with the exact version numbers here) and it doesn't offer forward compatibility too. Secondly, our product is expected to coup up with changes made to the devtools link release after release.

Is there any way to overcome these setbacks?

@qwelias
Copy link

qwelias commented Sep 28, 2022

Just make it a CLI flag --node-frontend
It should just launch the browser and do chrome.send('open-node-frontend') or whatever the Open dedicated DevTools for Node button does

@paulirish
Copy link
Member

There are a few HTML entrypoints, all with slightly different purposes. As of today, here's the list: https://github.com/ChromeDevTools/devtools-frontend/blob/4515db6fd9e9e8033ef08282d29c29a70a79a9ff/front_end/BUILD.gn#L99-L112

You can look in https://github.com/ChromeDevTools/devtools-frontend/tree/4515db6fd9e9e8033ef08282d29c29a70a79a9ff/front_end/entrypoints to get a sense of how each differs.

While stuff like this doesn't change often.. like Yang said... there are no compatibility promises around these URLs or their behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants