question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to debug with CEF on Windows

See original GitHub issue

Specification

  • pywebview version: 3.3.5
  • platform / version: Windows + CEF

Description

debug=True doesn’t propagate properly from start() While trying to get the debugger working in CEF, I noticed that as soon as create_window calls CEF.init(window) the value of _debug flips from True to False for some reason. They seem to be in the same thread, so I can only gather that it has something to do with the nature of declaring global _debug and changing it in start() doesn’t change it where it’s imported, sometimes. It seems fine in winforms.py but not in cef.py. Maybe because cef is conditionally imported? Dropping a breakpoint at line 72 https://github.com/r0x0r/pywebview/blob/952b3115c1b3b884e6a4d213a0a031bdea9e6609/webview/platforms/winforms.py#L71-L73 shows me that after this import, CEF._debug == False instead of True.

I actually came to post that I didn’t understand why, but I put a breakpoint on the line in cef.py where _debug is imported, and I realized that I was importing cef.py long before _debug is set to true in order to get to cef.settings . I don’t know why it became disjointed and lost the fact that the reference changed, but it feels like maybe this should be a is_debug() function in __init__.py instead of relying on it being a global variable.

Unfortunately there’s no workaround since you can’t pass the settings. I can’t change the settings after start() is called, and I can’t import it before either. The best I can do is force setting webview._debug=True and then importing cef.settings after that.

Practicalities

  • YES I am willing to work on this issue myself.

  • NO I am not prepared to support this issue financially.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
github-actions[bot]commented, Jan 5, 2021

The message to post on the issue when closing it. If none provided, will not comment when closing an issue.

1reaction
github-actions[bot]commented, Dec 31, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CEF Forum • Can't run debug version for VS2019(win32)
The error is a debug assertion, so it will not occur in a release build. You should still add the manifests as required....
Read more >
Remote Debugging not working with latest cef builds - Bitbucket
Run cefclient with flag remote-debugging-port=5000; Go to localhost:5000; Go to sources; Open any js file; Remote Debugging connection gets ...
Read more >
Debugging JavaScript in Chromium Embedded Framework
I got this working in CefSharp using the WinForms control in a WPF application. (the WinForms control seems to have better performance). The...
Read more >
Debugging Chromium on Windows
In Visual Studio, this goes in Tools > Options under Debugging > Symbols. You should set up a local cache in a empty...
Read more >
How to enable Debugging Tools for the Chromium browser ...
Enable Debugging Tools · Navigate to the Kapow Installation folder (by default C:\Program Files\Kapow <version>\) · go into \nativelib\hub\windows ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found