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

Allow opening devtools programmatically #287

Closed
lucasfernog opened this issue Jun 5, 2021 · 11 comments · Fixed by #489
Closed

Allow opening devtools programmatically #287

lucasfernog opened this issue Jun 5, 2021 · 11 comments · Fixed by #489

Comments

@lucasfernog
Copy link
Member

See tauri-apps/tauri#1213.

On Linux it can be done with https://docs.rs/webkit2gtk/0.11.0/webkit2gtk/trait.WebInspectorExt.html#tymethod.show

@lemarier
Copy link
Member

lemarier commented Jun 5, 2021

I got it to works on windows and linux.

Mac is a pain i need to keep trying… i’ll update my progress here.

@amrbashir
Copy link
Member

I think last time we checked macOs, it was a private api

@wusyong
Copy link
Member

wusyong commented Jun 5, 2021

yes it's a private api on mac. I don't feel like expose a method is a good idea in this case.
What do you think about setting some env variable so it could only affect debug build.

@lucasfernog
Copy link
Member Author

I think we can expose a method and hide it under #[cfg(debug_assertions)]

@wusyong wusyong added type: feature request platform: All help wanted Help is requested to fix this issue labels Jun 15, 2021
@lemarier lemarier changed the title Allow opening devtools on startup Allow opening devtools programmatically Jul 16, 2021
@wusyong
Copy link
Member

wusyong commented Jul 21, 2021

@schickling
Copy link

Thanks a lot for pushing this over the finish line @wusyong. Is this already somewhere in the docs?

@FabianLars
Copy link
Member

@schickling if you're asking about wry then yes:
https://docs.rs/wry/latest/wry/webview/struct.WebView.html#method.devtool
https://docs.rs/wry/latest/wry/webview/struct.WebViewBuilder.html#method.with_dev_tool
You need to enable the devtool feature flag tho: https://docs.rs/wry/latest/wry/index.html#feature-flags
Dev tools used to be enabled on debug builds only, this got replaced with this flag (so the flag is not only needed for the functions but also the dev tools in general)

If you're asking about tauri, then the docs won't be available until the next release (really really soon). If you're using the git version of tauri you can see the docs in the PR code: https://github.com/tauri-apps/tauri/pull/3350/files (this is not merged yet!).
tl;dr: enabled on debug builds and with the same devtool flag, so you don't need to build tauri (or wry) in debug mode anymore to ship your app with enabled devtools (mind the private API usage on macOS)

@KaKi87
Copy link

KaKi87 commented Feb 7, 2022

the next release (really really soon)

Could we be notified at that time ? Thanks

@FabianLars
Copy link
Member

Could we be notified at that time?

We have a discord channel for that and you can subscribe to GitHub notifications (watch -> releases only).

Otherwise I'd have to spend a whole day manually pinging people haha (you're not the first one askin for a notification, that's why)

@KaKi87
Copy link

KaKi87 commented Feb 7, 2022

We have a discord channel for that

Could a role mention be added to it ?

you can subscribe to GitHub notifications

Yeah but those are email-based.

Thanks

@FabianLars
Copy link
Member

We will most likely do a @here ping in either the news or the releases channel (probably both).

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

Successfully merging a pull request may close this issue.

7 participants