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

Access Inspector on MacOS? #529

Closed
gismofx opened this issue Jan 29, 2021 · 7 comments
Closed

Access Inspector on MacOS? #529

gismofx opened this issue Jan 29, 2021 · 7 comments

Comments

@gismofx
Copy link

gismofx commented Jan 29, 2021

I'm using webview sharp on MacOS 10.15.

I have a strange rendering issue that does not appear on windows and mac when same markup html is used directly via web. (Chrome, Safari, Edge) Also, no issues using webview sharp on windows.

I can't seem to access the inspector to debug visual issues(HTML, CSS, etc). When right-clicking in the view, only "Back" and "Refresh" are my options. Is it possible to access or enable inspector?

@geaz

@geaz
Copy link
Member

geaz commented Jan 29, 2021

If you are using edge, the developer tools are available by pressing F12. Is this working for you on mac?

@gismofx
Copy link
Author

gismofx commented Jan 29, 2021

@geaz Edge on Mac? Should I install? Any settings in my code? Download this? (Pressing F12 just increases my speaker volume :) )

Yes, on Windows it's working with Edge and I can access Inspector.

@geaz
Copy link
Member

geaz commented Jan 29, 2021

Forget about edge on Mac, I was a bit "confused" :D
On Mac webview is using "cocoa webview". Webview is activating the developer tools in theory.

developerExtrasEnabled

But to be honest, I really don't know how the tools are useable on Mac. Maybe anyone with a Mac can help here?

@gamelaster
Copy link

@geaz can be accessed via Safari as far as I know.

@gismofx
Copy link
Author

gismofx commented Jan 29, 2021

I can open inspector in Safari, but it's tied that instance. Can that somehow hook into my webview? Unfortunately I'm not a Mac expert either

@geaz can developerExtrasEnabled be turned on from webview sharp?

@gismofx
Copy link
Author

gismofx commented Jan 29, 2021

I came across these two links:
https://github.com/herrbischoff/awesome-macos-command-line

and this
https://developer.apple.com/forums/thread/4326#:~:text=with%20the%20bundle%20identifier%20of,contextual%20menus%20in%20your%20app.

Using lsappinfo in mac terminal yields this

25) "dotnet" ASN:0x0-0x2c02c: 
    bundleID=[ NULL ] 
    bundle path="/usr/local/share/dotnet/dotnet"
    executable path="/usr/local/share/dotnet/dotnet"
    pid = 549 type="Foreground" flavor=3 Version=[ NULL ]  fileType="????" creator="????" Arch=x86_64 
    parentASN="Terminal" ASN:0x0-0x20020:  (inferred)
    checkin time = 16 seconds ago, 2021/01/29 21:48:20 ( 15.9907 seconds ago )

26) "dotnet Networking" ASN:0x0-0x2d02d: 
    bundleID="com.apple.WebKit.Networking"
    bundle path="/System/Library/Frameworks/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.Networking.xpc"
    executable path="/System/Library/Frameworks/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.Networking.xpc/Contents/MacOS/com.apple.WebKit.Networking"
    pid = 551 !cgsConnection !signalled type="UIElement" flavor=[ NULL ]  Version="15609.4.1" fileType="XPC!" creator="????" Arch=x86_64 
    checkin time = 16 seconds ago, 2021/01/29 21:48:21 ( 15.7978 seconds ago )

27) "dotnet Web Content" ASN:0x0-0x2e02e: 
    bundleID="com.apple.WebKit.WebContent"
    bundle path="/System/Library/Frameworks/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc"
    executable path="/System/Library/Frameworks/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebContent"
    pid = 550 !cgsConnection !signalled type="UIElement" flavor=2 Version="15609.4.1" fileType="XPC!" creator="????" Arch=x86_64 sandboxed 

trying to enable inspector with the two found bundle ids did not work

@gismofx
Copy link
Author

gismofx commented Jan 30, 2021

Resolved.

Digging a little into this code developerExtrasEnabled is enabled when webview is passed a debug parameter = true. @geaz provides that parameter too :).

var webview = new Webview(debug: true)

@gismofx gismofx closed this as completed Jan 30, 2021
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