-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DevTools: improve UX for hosted mode + fix bug
This CL includes several quick improvements for hosted mode: - Properly serves InspectorBackendCommands.js. It turns out the metadata from the file is necessary for certain operations (e.g. $0 in the console). - Can now customize remote debugging port in addition to server port (e.g. REMOTE_DEBUGGING_PORT=9333 PORT=1234 npm run server) - Provides helpful info if you go to server root path: (e.g. http://localhost:8090/). As Paul pointed out, users may go here to check if the server is working. “Please go to http://localhost:9222#http://localhost:8090/front_end/inspector.html?experiments=true” (Note: it accounts for custom ports passed in) - Add chrome favicon (same favicon as https://developer.chrome.com/devtools) I'll update the docs with the RDP info once this CL has landed. BUG=629914 Review-Url: https://codereview.chromium.org/2195113002 Cr-Commit-Position: refs/heads/master@{#409878}
- Loading branch information
1 parent
180e6a4
commit 8974da1
Showing
2 changed files
with
22 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8974da1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@willchen90 Just wondering if it would be possible for me to get InspectorBackendCommands.js and SupportedCSSProperties.js from embedded devtools somehow. I have Dirac Chrome Extension wrapping my DevTools fork, so I could probably use chrome extension APIs to fetch the files from embedded DevTools somehow.
8974da1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recall @paulirish on IRC gave me once a
chrome://...
url to open embedded DevTools as a normal web app and that allowed me to tweak (experimental) DevTools's url params there. But I don't remember it anymore...8974da1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@darwin wow good eye. :)
Here's that magic URL fwiw: chrome-devtools://devtools/bundled/inspector.html
getting the file locally
I'm not sure if you can access these files from an extension as they are in the frontend on
chrome-devtools://
scheme, so i think you run into SOP problems.inspectorbackendcommands are not in release builds of chrome, but you find them concat'd into `chrome-devtools://devtools/bundled/inspector.js':
So if you manage to pull that file, you can parse that. Sounds exciting.
getting the file from appspot
The file that we're using in this case is located here: https://chrome-devtools-frontend.appspot.com/serve_file/@ec732aad75df3788dff99e857d86f4100a48d34a/InspectorBackendCommands.js
That git hash is the chromium git revision. It's not exposed to javascript, but https://omahaproxy.appspot.com/deps.json?version=54.0.2816.4 will allow you to map the chrome version (in the UA) into chromium rev. I would recommend the
chromium_base_commit
.We don't really maintain this as an API server so please don't hit it all the time. :)
gluck
8974da1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a million! @paulirish.
8974da1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paulirish yeah, CSP gets in the way, tried several dead ends today, but it turned out that it is possible to get my hands at it with
pageCapture
permission, in my background page I automate chrome to open a new tab and navigate tochrome-devtools://devtools/bundled/inspector.js
, I cannot inject content scripts or do anything useful with that page, except forpageCapture
which gives me mhtml back, which I can process further:Now it is just a matter of parsing that MIME format and "regex-ing" important parts out.
As a side note: Maybe the devtools team could consider exposing those files somehow from Chrome. The hosted mode dev-server could use that instead hitting your api/serve servers. (Not sure about security implications)