// The below classes implement support for routing aynchronous messages between
// JavaScript running in the renderer process and C++ running in the browser
// process. An application interacts with the router by passing it data from
// standard CEF C++ callbacks (OnBeforeBrowse, OnProcessMessageRecieved,
// OnContextCreated, etc). The renderer-side router supports generic JavaScript
// callback registration and execution while the browser-side router supports
// application-specific logic via one or more application-provided Handler
// instances.
//
// The renderer-side router implementation exposes a query function and a cancel
// function via the JavaScript 'window' object:
//
// // Create and send a new query.
// var request_id = window.cefQuery({
// request: 'my_request',
// persistent: false,
// onSuccess: function(response) {},
// onFailure: function(error_code, error_message) {}
// });
//
// // Optionally cancel the query.
// window.cefQueryCancel(request_id);
//
// When |window.cefQuery| is executed the request is sent asynchronously to one
// or more C++ Handler objects registered in the browser process. Each C++
// Handler can choose to either handle or ignore the query in the
// Handler::OnQuery callback. If a Handler chooses to handle the query then it
// should execute Callback::Success when a response is available or
// Callback::Failure if an error occurs. This will result in asynchronous
// execution of the associated JavaScript callback in the renderer process. Any
// queries unhandled by C++ code in the browser process will be automatically
// canceled and the associated JavaScript onFailure callback will be executed
// with an error code of -1.
//
// Queries can be either persistent or non-persistent. If the query is
// persistent than the callbacks will remain registered until one of the
// following conditions are met:
//
// A. The query is canceled in JavaScript using the |window.cefQueryCancel|
// function.
// B. The query is canceled in C++ code using the Callback::Failure function.
// C. The context associated with the query is released due to browser
// destruction, navigation or renderer process termination.
//
// If the query is non-persistent then the registration will be removed after
// the JavaScript callback is executed a single time. If a query is canceled for
// a reason other than Callback::Failure being executed then the associated
// Handler's OnQueryCanceled method will be called.
//
// Some possible usage patterns include:
//
// One-time Request. Use a non-persistent query to send a JavaScript request.
// The Handler evaluates the request and returns the response. The query is
// then discarded.
//
// Broadcast. Use a persistent query to register as a JavaScript broadcast
// receiver. The Handler keeps track of all registered Callbacks and executes
// them sequentially to deliver the broadcast message.
//
// Subscription. Use a persistent query to register as a JavaScript subscription
// receiver. The Handler initiates the subscription feed on the first request
// and delivers responses to all registered subscribers as they become
// available. The Handler cancels the subscription feed when there are no
// longer any registered JavaScript receivers.
//
// Message routing occurs on a per-browser and per-context basis. Consequently,
// additional application logic can be applied by restricting which browser or
// context instances are passed into the router. If you choose to use this
// approach do so cautiously. In order for the router to function correctly any
// browser or context instance passed into a single router callback must then
// be passed into all router callbacks.
//
// There is generally no need to have multiple renderer-side routers unless you
// wish to have multiple bindings with different JavaScript function names. It
// can be useful to have multiple browser-side routers with different client-
// provided Handler instances when implementing different behaviors on a per-
// browser basis.
//
// This implementation places no formatting restrictions on payload content.
// An application may choose to exchange anything from simple formatted
// strings to serialized XML or JSON data.
//
//
// EXAMPLE USAGE
//
// 1. Define the router configuration. You can optionally specify settings
// like the JavaScript function names. The configuration must be the same in
// both the browser and renderer processes. If using multiple routers in the
// same application make sure to specify unique function names for each
// router configuration.
//
// // Example config object showing the default values.
// CefMessageRouterConfig config;
// config.js_query_function = "cefQuery";
// config.js_cancel_function = "cefQueryCancel";
//
// 2. Create an instance of CefMessageRouterBrowserSide in the browser process.
// You might choose to make it a member of your CefClient implementation,
// for example.
//
// browser_side_router_ = CefMessageRouterBrowserSide::Create(config);
//
// 3. Register one or more Handlers. The Handler instances must either outlive
// the router or be removed from the router before they're deleted.
//
// browser_side_router_->AddHandler(my_handler);
//
// 4. Call all required CefMessageRouterBrowserSide methods from other callbacks
// in your CefClient implementation (OnBeforeClose, etc). See the
// CefMessageRouterBrowserSide class documentation for the complete list of
// methods.
//
// 5. Create an instance of CefMessageRouterRendererSide in the renderer process.
// You might choose to make it a member of your CefApp implementation, for
// example.
//
// renderer_side_router_ = CefMessageRouterRendererSide::Create(config);
//
// 6. Call all required CefMessageRouterRendererSide methods from other
// callbacks in your CefRenderProcessHandler implementation
// (OnContextCreated, etc). See the CefMessageRouterRendererSide class
// documentation for the complete list of methods.
//
// 7. Execute the query function from JavaScript code.
//
// window.cefQuery({request: 'my_request',
// persistent: false,
// onSuccess: function(response) { print(response); },
// onFailure: function(error_code, error_message) {} });
//
// 8. Handle the query in your Handler::OnQuery implementation and execute the
// appropriate callback either immediately or asynchronously.
//
// void MyHandler::OnQuery(int64 query_id,
// CefRefPtr<CefBrowser> browser,
// CefRefPtr<CefFrame> frame,
// const CefString& request,
// bool persistent,
// CefRefPtr<Callback> callback) {
// if (request == "my_request") {
// callback->Continue("my_response");
// return true;
// }
// return false; // Not handled.
// }
//
// 9. Notice that the onSuccess callback is executed in JavaScript.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
Xilium CefGlue 防谷歌浏览器操作,弹出新窗口改为新标签选项卡中打开,实现多功能,winform谷歌内核。并添加多款皮肤。添加 F12功能JS调试等。复制关闭标签页完善。方便大家学习参考。
资源推荐
资源详情
资源评论
收起资源包目录
Xilium CefGlue 防谷歌浏览器 弹出新窗口 改为新标签选项卡中打开 实现多功能 winform 谷歌内核 多款皮肤 F12 JS调试 (671个子文件)
snapshot_blob.bin 475KB
natives_blob.bin 402KB
CefWebBrowser.bmp 822B
DesignTimeResolveAssemblyReferences.cache 24KB
CefGlue.Client.csprojResolveAssemblyReference.cache 23KB
ResolveAssemblyReference.cache 13KB
CefGlue.WindowsForms.csprojResolveAssemblyReference.cache 10KB
ResolveAssemblyReference.cache 7KB
DesignTimeResolveAssemblyReferencesInput.cache 7KB
DesignTimeResolveAssemblyReferencesInput.cache 6KB
DesignTimeResolveAssemblyReferencesInput.cache 5KB
DesignTimeResolveAssemblyReferences.cache 4KB
CefGlue.csprojResolveAssemblyReference.cache 1KB
CefGlue.Client.csproj.GenerateResource.Cache 942B
DesignTimeResolveAssemblyReferences.cache 711B
app.config 316B
Xilium.CefGlue.Client.exe.config 316B
cef_menu_model_t.g.cs 47KB
cef_browser_host_t.g.cs 47KB
cef_v8value_t.g.cs 43KB
CefRuntime.cs 40KB
cef_xml_reader_t.g.cs 28KB
CefBrowserHost.cs 28KB
cef_dictionary_value_t.g.cs 28KB
cef_list_value_t.g.cs 26KB
CefMessageRouterBrowserSide.cs 24KB
cef_domnode_t.g.cs 24KB
CefV8Value.cs 24KB
cef_print_settings_t.g.cs 23KB
MainForm.cs 22KB
cef_frame_t.g.cs 22KB
cef_drag_data_t.g.cs 22KB
CefMessageRouterRendererSide.cs 21KB
cef_request_context_t.g.cs 21KB
cef_context_menu_params_t.g.cs 21KB
cef_value_t.g.cs 21KB
cef_command_line_t.g.cs 20KB
cef_browser_t.g.cs 20KB
cef_request_t.g.cs 20KB
MainForm.Designer.cs 19KB
CefRequestHandler.cs 18KB
CefMenuModel.cs 18KB
cef_download_item_t.g.cs 17KB
CefSettings.cs 17KB
cef_domdocument_t.g.cs 15KB
CefDictionaryValue.cs 15KB
CefRequestContext.cs 15KB
cef_sslinfo_t.g.cs 14KB
cef_zip_reader_t.g.cs 13KB
CefBrowserSettings.cs 13KB
CefXmlReader.cs 12KB
cef_response_t.g.cs 11KB
libcef.g.cs 11KB
cef_sslcert_principal_t.g.cs 11KB
CefListValue.cs 11KB
cef_v8context_t.g.cs 11KB
CefRenderHandler.cs 11KB
cef_navigation_entry_t.g.cs 10KB
CefCommandLine.cs 10KB
cef_cookie_manager_t.g.cs 10KB
cef_post_data_element_t.g.cs 10KB
cef_v8exception_t.g.cs 10KB
cef_v8stack_frame_t.g.cs 10KB
CefLifeSpanHandler.cs 9KB
KeyboardHook.cs 9KB
cef_domevent_t.g.cs 9KB
cef_post_data_t.g.cs 9KB
CefCookieManager.cs 9KB
cef_binary_value_t.g.cs 9KB
CefDragData.cs 9KB
CefRenderProcessHandler.cs 9KB
CefValue.cs 9KB
CefWebBrowser.cs 9KB
CefDomNode.cs 8KB
CefFrame.cs 8KB
CefPrintSettings.cs 8KB
cef_urlrequest_t.g.cs 8KB
CefClient.cs 8KB
WindowStylesEx.cs 8KB
CefRequest.cs 8KB
cef_task_runner_t.g.cs 8KB
CefContextMenuParams.cs 7KB
cef_stream_reader_t.g.cs 7KB
cef_request_handler_t.g.cs 7KB
cef_stream_writer_t.g.cs 7KB
cef_process_message_t.g.cs 7KB
CefClient.g.cs 7KB
CefRequestHandler.g.cs 7KB
CefBrowser.cs 6KB
CefWindowInfo.cs 6KB
cef_web_plugin_info_t.g.cs 6KB
cef_resource_bundle_t.g.cs 6KB
CefRenderProcessHandler.g.cs 6KB
cef_client_t.g.cs 6KB
CefV8Context.cs 5KB
cef_render_process_handler_t.g.cs 5KB
cef_v8stack_trace_t.g.cs 5KB
CefSslInfo.cs 5KB
CefRenderHandler.g.cs 5KB
cef_render_handler_t.g.cs 5KB
共 671 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
- xiangmingfei882020-03-30不错,很齐全
- wuqq10162020-11-16不错,还可以
- 罗治平的作品2019-06-29功能还可以。
本人QQ-554433626
- 粉丝: 56
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功