| 101 | |
| 102 | static hook::Hook<decltype(&cef_browser_host_create_browser)> CefBrowserHost_CreateBrowser; |
| 103 | static int Hooked_CefBrowserHost_CreateBrowser( |
| 104 | const cef_window_info_t* windowInfo, |
| 105 | struct _cef_client_t* client, |
| 106 | const cef_string_t* url, |
| 107 | const struct _cef_browser_settings_t* settings, |
| 108 | struct _cef_dictionary_value_t* extra_info, |
| 109 | struct _cef_request_context_t* request_context) |
| 110 | { |
| 111 | auto &url_ = CefStr::borrow(url); |
| 112 | |
| 113 | // Hook main browser only. |
| 114 | if (url_.startw("https://riot:") && url_.endw("/bootstrap.html")) |
| 115 | { |
| 116 | // Create extra info if null. |
| 117 | if (extra_info == nullptr) |
| 118 | extra_info = cef_dictionary_value_create(); |
| 119 | |
| 120 | // Set as main browser. |
| 121 | extra_info->set_null(extra_info, &u"is_main"_s); |
| 122 | |
| 123 | // Hook client. |
| 124 | HookMainBrowserClient(client); |
| 125 | } |
| 126 | |
| 127 | return CefBrowserHost_CreateBrowser(windowInfo, client, url, settings, extra_info, request_context); |
| 128 | } |
| 129 | |
| 130 | static decltype(cef_app_t::on_before_command_line_processing) OnBeforeCommandLineProcessing; |
| 131 | static void CEF_CALLBACK Hooked_OnBeforeCommandLineProcessing( |
nothing calls this directly
no test coverage detected