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

Chrome Extension? #64

Open
bahoo opened this issue Oct 13, 2017 · 4 comments
Open

Chrome Extension? #64

bahoo opened this issue Oct 13, 2017 · 4 comments

Comments

@bahoo
Copy link

bahoo commented Oct 13, 2017

Somewhere between a question and suggestion, certainly not a "issue" — could one craft a Chrome Extension to add "Copy as Python Request" directly to Chrome's Network tab options?

I've looked into it briefly and didn't get far, but stirring the pot for anyone who might be more skilled than me :D Also happy to close if this is too far off topic for this project.

@NickCarneiro
Copy link
Member

Technically it's possible! This package is pure JavaScript with no binary dependencies.

@NickCarneiro
Copy link
Member

Closing for now because I don't have the bandwidth, but cool idea.

@verhovsky
Copy link
Member

verhovsky commented Aug 19, 2022

Chrome would need to add an API for DevTools extensions to add stuff to the right click menu. I floated this idea to them:

https://bugs.chromium.org/p/chromium/issues/detail?id=1352771

Or they could agree to add "Copy as Python" to Chrome directly

https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2680281

@verhovsky verhovsky pinned this issue Aug 19, 2022
@verhovsky
Copy link
Member

verhovsky commented Aug 19, 2022

If you would like to try out my "Copy as Python (requests)" right click option, tell Chrome to load my fork of DevTools.

First, install Google's "git workflow-enhancing tools":

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$(realpath ./depot_tools):$PATH

Then clone and compile my fork

git clone https://github.com/verhovsky/devtools-frontend.git
cd devtools-frontend
git checkout saveaspython
gclient sync
gn gen out/Default
autoninja -C out/Default

Then start chrome, with the forked devtools:

# on Linux
chrome --custom-devtools-frontend=file://$(realpath out/Default/gen/front_end)
# on macOS you might need to specify the path to Chrome
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --custom-devtools-frontend=file://$(realpath out/Default/gen/front_end)

For details on compiling, see https://chromium.googlesource.com/devtools/devtools-frontend/+/refs/heads/chromium/3965/README.md

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

No branches or pull requests

3 participants