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

WebInspector does not automatically open on MacOS #1557

Open
ecxs-daedalus opened this issue Dec 29, 2024 · 2 comments
Open

WebInspector does not automatically open on MacOS #1557

ecxs-daedalus opened this issue Dec 29, 2024 · 2 comments

Comments

@ecxs-daedalus
Copy link

Specification

  • pywebview version: 5.3.2
  • operating system: MacOS Ventura 13.5.2 (22G91)
  • web renderer: WebKit

Description

On MacOS the Web Inspector does not automatically open when starting with Debug = True.
Opening via context menu still works, but impedes the ability to replace the context menu.

Is there a way to trigger the inspector from the python side?

@r0x0r
Copy link
Owner

r0x0r commented Dec 30, 2024

This is a known issue. I haven't found a way to programmarically open dev tools inspector.

@ecxs-daedalus
Copy link
Author

Ah thank you for the answer. I tried to dig around a bit and maybe found a workaround.

The automatic pop up of the Web Inspector might be restricted by apple to development via xcode.

This Stack-Overflow answer helped me find the posibility to attach the inspector from safari: https://stackoverflow.com/a/75984167

By changing cocoa.py on line 561:

        if _state['debug'] and webview_settings['OPEN_DEVTOOLS_IN_DEBUG']:
            self.webview.setInspectable_(True)
            config.preferences().setValue_forKey_(True, 'developerExtrasEnabled')

i got my app to show up on the safari dev menu and could attach the inspector as described.

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

2 participants