Skip to content

Commit

Permalink
Since version 126, CEF has changed its method to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Lecrapouille committed Dec 10, 2024
1 parent 9d402f2 commit 7b25934
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion addons/gdcef/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ In your GDScript, when initializing CEF, pass the following settings:
$CEF.initialize({"remote_debugging_port": 7777, "remote_allow_origin": "*", ... })
```

Open a Chrome browser and type in the URL: `http://localhost:7777`. You will see something like this:
Open a Chrome browser and type in the URL: `chrome://inspect`. A documents appears. Click on the `Configure` button of `Discover network targets`. Set `localhost:7777` as the port. You will see something like this:

![Debug](doc/pics/debug.png)

Expand Down
25 changes: 21 additions & 4 deletions addons/gdcef/gdcef/src/gdcef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,15 @@ static void configureCEF(fs::path const& folder,
cef_settings.command_line_args_disabled = true;

// Set to a value between 1024 and 65535 to enable remote debugging on the
// specified port. For example, if 7777 is specified the remote debugging
// URL will be http://localhost:7777. CEF can be remotely debugged from any
// CEF or Chrome browser window. Also configurable using the
// "remote-debugging-port" command-line switch.
// specified port. Also configurable using the "remote-debugging-port"
// command-line switch. Specifying 0 via the command-line switch will result
// in the selection of an ephemeral port and the port number will be printed
// as part of the WebSocket endpoint URL to stderr. If a cache directory
// path is provided the port will also be written to the
// <cache-dir>/DevToolsActivePort file. Remote debugging can be accessed by
// loading the chrome://inspect page in Google Chrome. Port numbers 9222 and
// 9229 are discoverable by default. Other port numbers may need to be
// configured via "Discover network targets" on the Devices tab.
cef_settings.remote_debugging_port =
getConfig(config, "remote_debugging_port", 7777);

Expand All @@ -458,6 +463,17 @@ static void configureCEF(fs::path const& folder,
cef_settings.uncaught_exception_stack_size =
getConfig(config, "exception_stack_size", 5);

// To persist session cookies (cookies without an expiry date or validity
// interval) by default when using the global cookie manager set this value
// to true (1). Session cookies are generally intended to be transient and
// most Web browsers do not persist them. A |cache_path| value must also be
// specified to enable this feature. Also configurable using the
// "persist-session-cookies" command-line switch. Can be overridden for
// individual CefRequestContext instances via the
// CefRequestContextSettings.persist_session_cookies value.
cef_settings.persist_session_cookies =
getConfig(config, "persist_session_cookies", true);

// Set to true (1) to have the browser process message loop run in a
// separate thread. If false (0) than the CefDoMessageLoopWork() function
// must be called from your application message loop. This option is only
Expand Down Expand Up @@ -702,6 +718,7 @@ void GDCef::Impl::OnBeforeCommandLineProcessing(
// Set to "*".
if (!m_owner.m_remote_allow_origin.empty())
{
command_line->AppendSwitch("allow-cef-debugger");
command_line->AppendSwitchWithValue(
"remote-allow-origins", m_owner.m_remote_allow_origin.c_str());
}
Expand Down

0 comments on commit 7b25934

Please sign in to comment.