{"id":4672,"date":"2016-04-07T16:08:42","date_gmt":"2016-04-07T07:08:42","guid":{"rendered":"https:\/\/peta.okechan.net\/blog\/?p=4672"},"modified":"2016-04-07T19:57:03","modified_gmt":"2016-04-07T10:57:03","slug":"cefsharp-%e3%81%ae-irequesthandler-%e3%81%af%e6%9c%80%e4%bd%8e%e9%99%90%e3%81%a9%e3%81%86%e5%ae%9f%e8%a3%85%e3%81%99%e3%82%8c%e3%81%b0%e3%82%88%e3%81%84%e3%81%8b","status":"publish","type":"post","link":"https:\/\/peta.okechan.net\/blog\/archives\/4672","title":{"rendered":"CefSharp \u306e IRequestHandler \u306f\u6700\u4f4e\u9650\u3069\u3046\u5b9f\u88c5\u3059\u308c\u3070\u3088\u3044\u304b"},"content":{"rendered":"<p><a href=\"https:\/\/github.com\/cefsharp\/CefSharp\">CefSharp<\/a> \u306e ChromiumWebBrowser \u3067\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u95a2\u3059\u308b\u51e6\u7406\u3092\u30ab\u30b9\u30bf\u30e0\u3059\u308b\u5834\u5408\u3001 CefSharp.IRequestHandler \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092 ChromiumWebBrowser \u306e RequestHandler \u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u30bb\u30c3\u30c8\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u30ea\u30f3\u30af\u3092\u958b\u304f\u76f4\u524d\u306b\u79fb\u52d5\u5148\u306eURL\u306b\u3088\u3063\u3066\u8a31\u53ef\u3057\u305f\u308a\u62d2\u5426\u3057\u305f\u308a\u3057\u305f\u3044\u5834\u5408\u306f\u3001 IRequestHandler \u306e\u30e1\u30bd\u30c3\u30c9 OnBeforeBrowse \u3092\u5b9f\u88c5\u3059\u308c\u3070\u826f\u3044\u306e\u3067\u3059\u304c\u3001 IRequestHandler \u306b\u306f\u4ed6\u306b\u3082\u591a\u6570\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u542b\u307e\u308c\u308b\u305f\u3081\u3001\u76ee\u7684\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u88c5\u3059\u308b\u3060\u3051\u3067\u306a\u304f\u4ed6\u306e\u30e1\u30bd\u30c3\u30c9\u306b\u3064\u3044\u3066\u3082\u5c11\u306a\u304f\u3068\u3082\u6700\u4f4e\u9650\u306e\u3082\u306e\u3092\u5b9f\u88c5\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u5404\u30e1\u30bd\u30c3\u30c9\u3092\u6700\u4f4e\u9650\u3069\u3046\u66f8\u3051\u3070\u3088\u3044\u304b\u306b\u3064\u3044\u3066\u306f<a href=\"https:\/\/github.com\/cefsharp\/CefSharp\/blob\/679fad6a891c9454ab1202005fde22c134da5f86\/CefSharp.Example\/RequestHandler.cs\">\u516c\u5f0f\u306e\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u306b\u542b\u307e\u308c\u308b\u30b3\u30fc\u30c9<\/a>\u306b\u7b54\u3048\u304c\u3042\u308b\u308f\u3051\u3067\u3059\u304c\u3001\u305d\u306e\u300c\u7b54\u3048\u300d\u304c\u300c\u306a\u305c\u305d\u308c\u3067\u826f\u3044\u306e\u304b\u300d\u306b\u3064\u3044\u3066\u306f\u3088\u304f\u5206\u304b\u3089\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u30bd\u30fc\u30b9\u3092\u8aad\u307f\u306a\u304c\u3089\u81ea\u5206\u306a\u308a\u306e\u300c\u6700\u4f4e\u9650\u306e\u7b54\u3048\u300d\u3092\u5c0e\u304d\u51fa\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u3068\u3044\u3063\u3066\u3082\u8aad\u3093\u3060\u306e\u306f\u4e3b\u306b <a href=\"https:\/\/github.com\/cefsharp\/CefSharp\/blob\/5f087838acb4b8fa34644026ba81afead898409b\/CefSharp\/IRequestHandler.cs\">IRequestHandler \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u306e\u30bd\u30fc\u30b9<\/a>\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u30b3\u30e1\u30f3\u30c8\u3060\u3051\u3067\u3059\u3002<\/p>\n<h3>IRequestHandler \u306e\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p>\u7b54\u3048\u306e\u524d\u306b\u307e\u305a\u306f\u5404\u30e1\u30bd\u30c3\u30c9\u306e\u7c21\u5358\u306a\u8aac\u660e\u3092\u3002<br \/>\n\u6b32\u3057\u3044\u306e\u306f\u300c\u6700\u4f4e\u9650\u300d\u3067\u3059\u306e\u3067\u3001\u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3070\u308c\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u3068\u30e1\u30bd\u30c3\u30c9\u306e\u623b\u308a\u5024\u4ee5\u5916\u306b\u3064\u3044\u3066\u306f\u7279\u306b\u89e6\u308c\u307e\u305b\u3093\u3002<\/p>\n<ul>\n<li>\n<code>bool OnBeforeBrowse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, bool isRedirect);<\/code><br \/>\n\u30d6\u30e9\u30a6\u30b6\u306e\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u304c\u884c\u308f\u308c\u308b\u76f4\u524d\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\n\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b\u5834\u5408\u306f true \u3092\u3001\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3092\u7d9a\u884c\u3059\u308b\u5834\u5408\u306f false \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>bool OnOpenUrlFromTab(IWebBrowser browserControl, IBrowser browser, IFrame frame, string targetUrl, WindowOpenDisposition targetDisposition, bool userGesture);<\/code><br \/>\n\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u306b\u3088\u3063\u3066\u65b0\u3057\u3044\u30bf\u30d6\u3084\u30a6\u30a4\u30f3\u30c9\u30a6\u304c\u958b\u304b\u308c\u308b\u3088\u3046\u306a\u5834\u5408\u306b\u3001 OnBeforeBrowse \u3088\u308a\u5148\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\n\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b\u5834\u5408\u306f true \u3092\u3001\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3092\u7d9a\u884c\u3059\u308b\u5834\u5408\u306f false \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>bool OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback);<\/code><br \/>\n\u6b63\u3057\u304f\u306a\u3044SSL\u8a3c\u660e\u66f8\u3092\u6301\u3064\u30da\u30fc\u30b8\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u305f\u969b\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\n\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b\u5834\u5408\u306f false \u3092\u3001\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3092\u7d9a\u884c\u3059\u308b\u5834\u5408\u306f true \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>void OnPluginCrashed(IWebBrowser browserControl, IBrowser browser, string pluginPath);<\/code><br \/>\n\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u305f\u969b\u306b\u547c\u3070\u308c\u308b\u3002\n<\/li>\n<li>\n<code>CefReturnValue OnBeforeResourceLoad(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IRequestCallback callback);<\/code><br \/>\n\u30ea\u30bd\u30fc\u30b9\u3078\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u884c\u308f\u308c\u308b\u524d\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\n\u30ea\u30bd\u30fc\u30b9\u306e\u8aad\u307f\u8fbc\u307f\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b\u5834\u5408\u306f CefReturnValue.Cancel \u3092\u3001\u7d9a\u884c\u3059\u308b\u5834\u5408\u306f CefReturnValue.Continue \u3092\u3001\u975e\u540c\u671f\u51e6\u7406\u3092\u7528\u3044\u3064\u3064\u7d9a\u884c\u3059\u308b\u5834\u5408\u306f CefReturnValue.ContinueAsync \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>bool GetAuthCredentials(IWebBrowser browserControl, IBrowser browser, IFrame frame, bool isProxy, string host, int port, string realm, string scheme, IAuthCallback callback);<\/code><br \/>\n\u30d6\u30e9\u30a6\u30b6\u304c\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u306e\u8cc7\u683c\u60c5\u5831\u3092\u5fc5\u8981\u3068\u3057\u305f\u969b\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\n\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b\u306b\u306f false \u3092\u3001\u7d9a\u884c\u3059\u308b\u5834\u5408\u306f true \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>void OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status);<\/code><br \/>\n\u30ec\u30f3\u30c0\u30fc\u30d7\u30ed\u30bb\u30b9\u304c\u4e88\u671f\u305b\u305a\u7d42\u4e86\u3057\u305f\u969b\u306b\u547c\u3070\u308c\u308b\u3002\n<\/li>\n<li>\n<code>bool OnQuotaRequest(IWebBrowser browserControl, IBrowser browser, string originUrl, Int64 newSize, IRequestCallback callback);<\/code><br \/>\nJavaScript \u304b\u3089 webkitStorageInfo.requestQuota \u95a2\u6570\u306b\u3088\u3063\u3066\u660e\u793a\u7684\u306b\u30af\u30a9\u30fc\u30bf\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3057\u3066\u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u8981\u6c42\u3055\u308c\u305f\u5834\u5408\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\n\u8981\u6c42\u3092\u62d2\u5426\u3059\u308b\u5834\u5408\u306f false \u3092\u3001\u8a31\u53ef\u3059\u308b\u5834\u5408\u306f true \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>void OnResourceRedirect(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, ref string newUrl);<\/code><br \/>\n\u30ea\u30bd\u30fc\u30b9\u306e\u8aad\u307f\u8fbc\u307f\u304c\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3055\u308c\u305f\u969b\u306b\u547c\u3070\u308c\u308b\u3002\n<\/li>\n<li>\n<code>bool OnProtocolExecution(IWebBrowser browserControl, IBrowser browser, string url);<\/code><br \/>\n\u4e0d\u660e\u306a\u30d7\u30ed\u30c8\u30b3\u30eb\u306eURL\u304c\u30ea\u30af\u30a8\u30b9\u30c8\u3055\u308c\u305f\u6642\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\nOS\u306b\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u30d7\u30ed\u30c8\u30b3\u30eb\u30cf\u30f3\u30c9\u30e9\u3067\u51e6\u7406\u3059\u308b\u5834\u5408\u306f true \u3092\u3001\u305d\u308c\u4ee5\u5916\u306e\u5834\u5408\u306f false \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>void OnRenderViewReady(IWebBrowser browserControl, IBrowser browser);<\/code><br \/>\n\u30d6\u30e9\u30a6\u30b6\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u305f\u30ec\u30f3\u30c0\u30fc\u30d3\u30e5\u30fc\u304cIPC\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51e6\u7406\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u969b\u306b\u547c\u3070\u308c\u308b\u3002\n<\/li>\n<li>\n<code>bool OnResourceResponse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response);<\/code><br \/>\n\u30ea\u30bd\u30fc\u30b9\u306e\u5fdc\u7b54\u3092\u53d7\u3051\u53d6\u3063\u305f\u969b\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\n\u30ea\u30bd\u30fc\u30b9\u3092\u666e\u901a\u306b\u8aad\u307f\u8fbc\u3080\u5834\u5408\u306f false \u3092\u3001\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3084\u30ea\u30c8\u30e9\u30a4\u3092\u3059\u308b\u5834\u5408\u306f true \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>IResponseFilter GetResourceResponseFilter(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response);<\/code><br \/>\n\u30ea\u30bd\u30fc\u30b9\u306e\u5fdc\u7b54\u5185\u5bb9\u3092\u30d5\u30a3\u30eb\u30bf\u3059\u308b\u305f\u3081\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\n\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u30d5\u30a3\u30eb\u30bf\u3059\u308b\u5834\u5408\u306f IResponseFilter \u3092\u5b9f\u88c5\u3057\u305f\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u8fd4\u3059\u3002\u305d\u308c\u4ee5\u5916\u306e\u5834\u5408\u306f\u3000null \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>void OnResourceLoadComplete(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response, UrlRequestStatus status, long receivedContentLength);<\/code><br \/>\n\u30ea\u30bd\u30fc\u30b9\u306e\u8aad\u307f\u8fbc\u307f\u304c\u5b8c\u4e86\u3057\u305f\u969b\u306b\u547c\u3070\u308c\u308b\u3002\n<\/li>\n<\/ul>\n<p>\u5168\u90e8\u306714\u500b\u3042\u308a\u307e\u3059(-_-;)<br \/>\n\u305f\u3060\u3057\u4eca\u65e5\u73fe\u5728\u3001 GetResourceResponseFilter \u306f\u6700\u65b0\u306e\u30bd\u30fc\u30b9\u306b\u306f\u542b\u307e\u308c\u3066\u307e\u3059\u304c\u3001NuGet\u306e\u6700\u65b0v47.0.3\u306b\u306f\u307e\u3060\u542b\u307e\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u6b21\u306e\u5b9f\u88c5\u4f8b\u306b\u306f\u542b\u3081\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>true \u3092\u8fd4\u3059\u3053\u3068\u3067\u30ad\u30e3\u30f3\u30bb\u30eb\u3092\u8868\u73fe\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3082\u3042\u308c\u3070\u3001 false \u3092\u8fd4\u3059\u3053\u3068\u3067\u30ad\u30e3\u30f3\u30bb\u30eb\u3092\u8868\u73fe\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3082\u3042\u308a\u3001\u975e\u5e38\u306b\u5206\u304b\u308a\u3065\u3089\u3044\u611f\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u3067\u3059\u304c\u3088\u304f\u8abf\u3079\u308b\u3068\u3001 bool \u3092\u8fd4\u3059\u30e1\u30bd\u30c3\u30c9\u3067\u306f false \u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306b\u306a\u308b\u3088\u3046\u6562\u3048\u3066\u771f\u507d\u5024\u306e\u610f\u5473\u3092\u5909\u3048\u3066\u308b\u3088\u3046\u3067\u3059\u3002<br \/>\n\u3067\u3042\u308c\u3070\u3001\u3068\u306b\u304b\u304f false \u3092\u8fd4\u3057\u3066\u304a\u3051\u3070\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u52d5\u4f5c\u306b\u306a\u308b\u308f\u3051\u3067\u3059\u304b\u3089\u3042\u308b\u610f\u5473\u5206\u304b\u308a\u3084\u3059\u3044\u3068\u3082\u3044\u3048\u307e\u3059\u3002<br \/>\n\uff08\u79c1\u304c\u8a2d\u8a08\u3059\u308b\u3068\u304d\u306b\u771f\u4f3c\u3057\u305f\u3044\u3068\u306f\u601d\u308f\u306a\u3044\u3051\u3069\uff09<\/p>\n<p>\u305d\u308c\u3068\u30e1\u30bd\u30c3\u30c9\u306e\u540d\u524d\u304c\u8fd4\u308a\u5024\u306b\u3064\u3044\u3066\u8aac\u660e\u3059\u308b\u3088\u3046\u306a\u3082\u306e\u306b\u306a\u3063\u3066\u306a\u3044\u306e\u3082\u3064\u3089\u3044\u3067\u3059\u3002<br \/>\n\u3067\u3059\u304c\u3053\u308c\u3082\u3001\u300c\u30e1\u30bd\u30c3\u30c9\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u300d\u3067\u306f\u306a\u304f\u300c\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u300d\u3068\u8003\u3048\u308c\u3070\u7406\u89e3\u3067\u304d\u307e\u3059\u3002<br \/>\n\uff08\u79c1\u304c\u8a2d\u8a08\u3059\u308b\u3068\u304d\u306f\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u3092\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3067\u5b9a\u7fa9\u3057\u3088\u3046\u3068\u306f\u601d\u308f\u306a\u3044\u3051\u3069\uff09<\/p>\n<h3>IRequestHandler \u3092\u5b9f\u88c5\u3059\u308b\u6700\u4f4e\u9650\u306e\u30af\u30e9\u30b9<\/h3>\n<p>\u4ee5\u4e0a\u3092\u8e0f\u307e\u3048\u305f\u300c\u307c\u304f\u306e\u8003\u3048\u305f\u6700\u5f31\u306e\u5b9f\u88c5\u300d\u3067\u3059\u3002<br \/>\n\u3053\u308c\u3060\u3051\u3067\u306f\u4f55\u3082\u3057\u306a\u3044\u610f\u5473\u306e\u306a\u3044\u30af\u30e9\u30b9\u3067\u3059\u304c\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u95a2\u9023\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3092\u884c\u3046\u305f\u3081\u306e\u30b9\u30bf\u30fc\u30c8\u5730\u70b9\u3068\u306a\u308b\u30af\u30e9\u30b9\u3067\u3059\u3002<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nusing CefSharp;\r\n\r\nnamespace MyCefSharpTest\r\n{\r\n    class MyRequestHandler : IRequestHandler\r\n    {\r\n        bool IRequestHandler.OnBeforeBrowse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, bool isRedirect)\r\n        {\r\n            return false;\r\n        }\r\n\r\n        bool IRequestHandler.OnOpenUrlFromTab(IWebBrowser browserControl, IBrowser browser, IFrame frame, string targetUrl, WindowOpenDisposition targetDisposition, bool userGesture)\r\n        {\r\n            return false;\r\n        }\r\n\r\n        bool IRequestHandler.OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback)\r\n        {\r\n            return false;\r\n        }\r\n\r\n        void IRequestHandler.OnPluginCrashed(IWebBrowser browserControl, IBrowser browser, string pluginPath)\r\n        {\r\n        }\r\n\r\n        CefReturnValue IRequestHandler.OnBeforeResourceLoad(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IRequestCallback callback)\r\n        {\r\n            return CefReturnValue.Continue;\r\n        }\r\n\r\n        bool IRequestHandler.GetAuthCredentials(IWebBrowser browserControl, IBrowser browser, IFrame frame, bool isProxy, string host, int port, string realm, string scheme, IAuthCallback callback)\r\n        {\r\n            callback.Dispose();\r\n            return false;\r\n        }\r\n        void IRequestHandler.OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status)\r\n        {\r\n        }\r\n\r\n        bool IRequestHandler.OnQuotaRequest(IWebBrowser browserControl, IBrowser browser, string originUrl, long newSize, IRequestCallback callback)\r\n        {\r\n            return false;\r\n        }\r\n\r\n        void IRequestHandler.OnResourceRedirect(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, ref string newUrl)\r\n        {\r\n        }\r\n\r\n        bool IRequestHandler.OnProtocolExecution(IWebBrowser browserControl, IBrowser browser, string url)\r\n        {\r\n            return false;\r\n        }\r\n\r\n        void IRequestHandler.OnRenderViewReady(IWebBrowser browserControl, IBrowser browser)\r\n        {\r\n        }\r\n\r\n        bool IRequestHandler.OnResourceResponse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response)\r\n        {\r\n            return false;\r\n        }\r\n\r\n        void IRequestHandler.OnResourceLoadComplete(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response, UrlRequestStatus status, long receivedContentLength)\r\n        {\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p>\u3053\u3046\u3084\u3063\u3066\u307e\u3068\u3081\u3066\u898b\u308b\u3068\u3001\u57fa\u672c\u7684\u306b void \u306a\u30e1\u30bd\u30c3\u30c9\u306f\u7a7a\u306b\u3001 bool \u306a\u30e1\u30bd\u30c3\u30c9\u306f false \u3092\u8fd4\u3059\u3088\u3046\u306b\u3001 CefReturnValue \u306a\u30e1\u30bd\u30c3\u30c9\u306f\u3000CefReturnValue.Continue \u3092\u8fd4\u3059\u3088\u3046\u306b\u3057\u305f\u3060\u3051\u3067\u3059\u306d\u3002<br \/>\nGetAuthCredentials \u3060\u3051\u306f callback.Dispose(); \u306e\u884c\u304c\u8ffd\u52a0\u3055\u308c\u3066\u307e\u3059\u304c\u3001\u3053\u308c\u306f\u516c\u5f0f\u306e\u30b5\u30f3\u30d7\u30eb\u306e\u30bd\u30fc\u30b9\u4e2d\u306b\u305d\u3046\u3059\u308b\u3088\u3046\u306b\u304a\u3059\u3059\u3081\u3059\u308b\u3068\u30b3\u30e1\u30f3\u30c8\u304c\u66f8\u304b\u308c\u3066\u3044\u305f\u305f\u3081\u305d\u3046\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u7d42\u308f\u3063\u3066\u307f\u308c\u3070\u7c21\u5358\u306a\u4e8b\u3067\u3059\u304c\u3001\u6700\u521d\u306f\u300c\u3053\u308c\u3060\u3051\u306e\u30e1\u30bd\u30c3\u30c9\u3069\u3046\u3084\u3063\u3066\u5b9f\u88c5\u3059\u308b\u3093\u3060\u2026\u300d\u3068\u8efd\u304f\u9014\u65b9\u306b\u66ae\u308c\u307e\u3057\u305f\u3002<br \/>\n\u4e00\u3064\u306e\u30e1\u30bd\u30c3\u30c9\uff08\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\uff09\u3092\u30ab\u30b9\u30bf\u30e0\u3057\u305f\u3044\u3060\u3051\u306a\u306e\u306b\u3001\u591a\u6570\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u3072\u3068\u3064\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u306b\u307e\u3068\u307e\u3063\u3066\u308b\u304c\u305f\u3081\u306b\u5168\u90e8\u5b9f\u88c5\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u306e\u306f\u3001\u3069\u3046\u5b9f\u88c5\u3059\u308b\u304b\u5206\u304b\u3063\u305f\u4eca\u3067\u3082\u9762\u5012\u306a\u611f\u3058\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u79c1\u306f OnBeforeBrowse \u306e\u30ab\u30b9\u30bf\u30e0\u3092\u76ee\u7684\u3068\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u4ed6\u306e\u30c6\u30af\u30ce\u30ed\u30b8\u3067\u3042\u308c\u3070\u540c\u3058\u3088\u3046\u306a\u30a4\u30d9\u30f3\u30c8\u304c\u30d6\u30e9\u30a6\u30b6\u306b\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u7c21\u5358\u306b\u30ab\u30b9\u30bf\u30e0\u3067\u304d\u308b\u3093\u3067\u3059\u3088\u306d\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067 IRequestHandler \u3092\u5b9f\u88c5\u3057\u3088\u3046\u3068\u3057\u305f\u3089\u30e1\u30bd\u30c3\u30c9\u304c\u591a\u3059\u304e\u3066\u9014\u65b9\u306b\u66ae\u308c\u305f\u65b9\u306f\u662f\u975e\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\uff08\u3042\u307e\u308a\u5c45\u306a\u3044\u304b\u306a\uff1fw\uff09<\/p>\n<h4>\u53c2\u8003: \u4ed6\u306e\u30c6\u30af\u30ce\u30ed\u30b8\u306b\u304a\u3044\u3066 OnBeforeBrowse \u30a4\u30d9\u30f3\u30c8\u306b\u76f8\u5f53\u3059\u308b\u30a4\u30d9\u30f3\u30c8<\/h4>\n<table>\n<tr>\n<td>\u30c6\u30af\u30ce\u30ed\u30b8<\/td>\n<td>\u30d6\u30e9\u30a6\u30b6\u30af\u30e9\u30b9<\/td>\n<td>\u30a4\u30d9\u30f3\u30c8<\/td>\n<\/tr>\n<tr>\n<td>Windows Forms<\/td>\n<td>System.Windows.Forms.WebBrowser<\/td>\n<td>Navigating<\/td>\n<\/tr>\n<tr>\n<td>UWP<\/td>\n<td>Windows.UI.Xaml.Controls.WebView<\/td>\n<td>NavigationStarting<\/td>\n<\/tr>\n<tr>\n<td>Geckofx<\/td>\n<td>Gecko.GeckoWebBrowser<\/td>\n<td>Navigating<\/td>\n<\/tr>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p><a href=\"https:\/\/github.com\/cefsharp\/CefSharp\">CefSharp<\/a> \u306e ChromiumWebBrowser \u3067\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u95a2\u3059\u308b\u51e6\u7406\u3092\u30ab\u30b9\u30bf\u30e0\u3059\u308b\u5834\u5408\u3001 CefSharp.IRequestHandler \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092 ChromiumWebBrowser \u306e RequestHandler \u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u30bb\u30c3\u30c8\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u30ea\u30f3\u30af\u3092\u958b\u304f\u76f4\u524d\u306b\u79fb\u52d5\u5148\u306eURL\u306b\u3088\u3063\u3066\u8a31\u53ef\u3057\u305f\u308a\u62d2\u5426\u3057\u305f\u308a\u3057\u305f\u3044\u5834\u5408\u306f\u3001 IRequestHandler \u306e\u30e1\u30bd\u30c3\u30c9 OnBeforeBrowse \u3092\u5b9f\u88c5\u3059\u308c\u3070\u826f\u3044\u306e\u3067\u3059\u304c\u3001 IRequestHandler \u306b\u306f\u4ed6\u306b\u3082\u591a\u6570\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u542b\u307e\u308c\u308b\u305f\u3081\u3001\u76ee\u7684\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u88c5\u3059\u308b\u3060\u3051\u3067\u306a\u304f\u4ed6\u306e\u30e1\u30bd\u30c3\u30c9\u306b\u3064\u3044\u3066\u3082\u5c11\u306a\u304f\u3068\u3082\u6700\u4f4e\u9650\u306e\u3082\u306e\u3092\u5b9f\u88c5\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u5404\u30e1\u30bd\u30c3\u30c9\u3092\u6700\u4f4e\u9650\u3069\u3046\u66f8\u3051\u3070\u3088\u3044\u304b\u306b\u3064\u3044\u3066\u306f<a href=\"https:\/\/github.com\/cefsharp\/CefSharp\/blob\/679fad6a891c9454ab1202005fde22c134da5f86\/CefSharp.Example\/RequestHandler.cs\">\u516c\u5f0f\u306e\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u306b\u542b\u307e\u308c\u308b\u30b3\u30fc\u30c9<\/a>\u306b\u7b54\u3048\u304c\u3042\u308b\u308f\u3051\u3067\u3059\u304c\u3001\u305d\u306e\u300c\u7b54\u3048\u300d\u304c\u300c\u306a\u305c\u305d\u308c\u3067\u826f\u3044\u306e\u304b\u300d\u306b\u3064\u3044\u3066\u306f\u3088\u304f\u5206\u304b\u3089\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u30bd\u30fc\u30b9\u3092\u8aad\u307f\u306a\u304c\u3089\u81ea\u5206\u306a\u308a\u306e\u300c\u6700\u4f4e\u9650\u306e\u7b54\u3048\u300d\u3092\u5c0e\u304d\u51fa\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u3068\u3044\u3063\u3066\u3082\u8aad\u3093\u3060\u306e\u306f\u4e3b\u306b <a href=\"https:\/\/github.com\/cefsharp\/CefSharp\/blob\/5f087838acb4b8fa34644026ba81afead898409b\/CefSharp\/IRequestHandler.cs\">IRequestHandler \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u306e\u30bd\u30fc\u30b9<\/a>\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u30b3\u30e1\u30f3\u30c8\u3060\u3051\u3067\u3059\u3002<\/p>\n<h3>IRequestHandler \u306e\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p>\u7b54\u3048\u306e\u524d\u306b\u307e\u305a\u306f\u5404\u30e1\u30bd\u30c3\u30c9\u306e\u7c21\u5358\u306a\u8aac\u660e\u3092\u3002<br \/>\n\u6b32\u3057\u3044\u306e\u306f\u300c\u6700\u4f4e\u9650\u300d\u3067\u3059\u306e\u3067\u3001\u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3070\u308c\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u3068\u30e1\u30bd\u30c3\u30c9\u306e\u623b\u308a\u5024\u4ee5\u5916\u306b\u3064\u3044\u3066\u306f\u7279\u306b\u89e6\u308c\u307e\u305b\u3093\u3002<\/p>\n<ul>\n<li>\n<code>bool OnBeforeBrowse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, bool isRedirect);<\/code><br \/>\n\u30d6\u30e9\u30a6\u30b6\u306e\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u304c\u884c\u308f\u308c\u308b\u76f4\u524d\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\n\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b\u5834\u5408\u306f true \u3092\u3001\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3092\u7d9a\u884c\u3059\u308b\u5834\u5408\u306f false \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>bool OnOpenUrlFromTab(IWebBrowser browserControl, IBrowser browser, IFrame frame, string targetUrl, WindowOpenDisposition targetDisposition, bool userGesture);<\/code><br \/>\n\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u306b\u3088\u3063\u3066\u65b0\u3057\u3044\u30bf\u30d6\u3084\u30a6\u30a4\u30f3\u30c9\u30a6\u304c\u958b\u304b\u308c\u308b\u3088\u3046\u306a\u5834\u5408\u306b\u3001 OnBeforeBrowse \u3088\u308a\u5148\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\n\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b\u5834\u5408\u306f true \u3092\u3001\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3092\u7d9a\u884c\u3059\u308b\u5834\u5408\u306f false \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>bool OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback);<\/code><br \/>\n\u6b63\u3057\u304f\u306a\u3044SSL\u8a3c\u660e\u66f8\u3092\u6301\u3064\u30da\u30fc\u30b8\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u305f\u969b\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\n\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b\u5834\u5408\u306f false \u3092\u3001\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3092\u7d9a\u884c\u3059\u308b\u5834\u5408\u306f true \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>void OnPluginCrashed(IWebBrowser browserControl, IBrowser browser, string pluginPath);<\/code><br \/>\n\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u305f\u969b\u306b\u547c\u3070\u308c\u308b\u3002\n<\/li>\n<li>\n<code>CefReturnValue OnBeforeResourceLoad(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IRequestCallback callback);<\/code><br \/>\n\u30ea\u30bd\u30fc\u30b9\u3078\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u884c\u308f\u308c\u308b\u524d\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\n\u30ea\u30bd\u30fc\u30b9\u306e\u8aad\u307f\u8fbc\u307f\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b\u5834\u5408\u306f CefReturnValue.Cancel \u3092\u3001\u7d9a\u884c\u3059\u308b\u5834\u5408\u306f CefReturnValue.Continue \u3092\u3001\u975e\u540c\u671f\u51e6\u7406\u3092\u7528\u3044\u3064\u3064\u7d9a\u884c\u3059\u308b\u5834\u5408\u306f CefReturnValue.ContinueAsync \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>bool GetAuthCredentials(IWebBrowser browserControl, IBrowser browser, IFrame frame, bool isProxy, string host, int port, string realm, string scheme, IAuthCallback callback);<\/code><br \/>\n\u30d6\u30e9\u30a6\u30b6\u304c\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u306e\u8cc7\u683c\u60c5\u5831\u3092\u5fc5\u8981\u3068\u3057\u305f\u969b\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\n\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b\u306b\u306f false \u3092\u3001\u7d9a\u884c\u3059\u308b\u5834\u5408\u306f true \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>void OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status);<\/code><br \/>\n\u30ec\u30f3\u30c0\u30fc\u30d7\u30ed\u30bb\u30b9\u304c\u4e88\u671f\u305b\u305a\u7d42\u4e86\u3057\u305f\u969b\u306b\u547c\u3070\u308c\u308b\u3002\n<\/li>\n<li>\n<code>bool OnQuotaRequest(IWebBrowser browserControl, IBrowser browser, string originUrl, Int64 newSize, IRequestCallback callback);<\/code><br \/>\nJavaScript \u304b\u3089 webkitStorageInfo.requestQuota \u95a2\u6570\u306b\u3088\u3063\u3066\u660e\u793a\u7684\u306b\u30af\u30a9\u30fc\u30bf\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3057\u3066\u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u8981\u6c42\u3055\u308c\u305f\u5834\u5408\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\n\u8981\u6c42\u3092\u62d2\u5426\u3059\u308b\u5834\u5408\u306f false \u3092\u3001\u8a31\u53ef\u3059\u308b\u5834\u5408\u306f true \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>void OnResourceRedirect(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, ref string newUrl);<\/code><br \/>\n\u30ea\u30bd\u30fc\u30b9\u306e\u8aad\u307f\u8fbc\u307f\u304c\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3055\u308c\u305f\u969b\u306b\u547c\u3070\u308c\u308b\u3002\n<\/li>\n<li>\n<code>bool OnProtocolExecution(IWebBrowser browserControl, IBrowser browser, string url);<\/code><br \/>\n\u4e0d\u660e\u306a\u30d7\u30ed\u30c8\u30b3\u30eb\u306eURL\u304c\u30ea\u30af\u30a8\u30b9\u30c8\u3055\u308c\u305f\u6642\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\nOS\u306b\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u30d7\u30ed\u30c8\u30b3\u30eb\u30cf\u30f3\u30c9\u30e9\u3067\u51e6\u7406\u3059\u308b\u5834\u5408\u306f true \u3092\u3001\u305d\u308c\u4ee5\u5916\u306e\u5834\u5408\u306f false \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>void OnRenderViewReady(IWebBrowser browserControl, IBrowser browser);<\/code><br \/>\n\u30d6\u30e9\u30a6\u30b6\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u305f\u30ec\u30f3\u30c0\u30fc\u30d3\u30e5\u30fc\u304cIPC\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51e6\u7406\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u969b\u306b\u547c\u3070\u308c\u308b\u3002\n<\/li>\n<li>\n<code>bool OnResourceResponse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response);<\/code><br \/>\n\u30ea\u30bd\u30fc\u30b9\u306e\u5fdc\u7b54\u3092\u53d7\u3051\u53d6\u3063\u305f\u969b\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\n\u30ea\u30bd\u30fc\u30b9\u3092\u666e\u901a\u306b\u8aad\u307f\u8fbc\u3080\u5834\u5408\u306f false \u3092\u3001\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3084\u30ea\u30c8\u30e9\u30a4\u3092\u3059\u308b\u5834\u5408\u306f true \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>IResponseFilter GetResourceResponseFilter(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response);<\/code><br \/>\n\u30ea\u30bd\u30fc\u30b9\u306e\u5fdc\u7b54\u5185\u5bb9\u3092\u30d5\u30a3\u30eb\u30bf\u3059\u308b\u305f\u3081\u306b\u547c\u3070\u308c\u308b\u3002<br \/>\n\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u30d5\u30a3\u30eb\u30bf\u3059\u308b\u5834\u5408\u306f IResponseFilter \u3092\u5b9f\u88c5\u3057\u305f\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u8fd4\u3059\u3002\u305d\u308c\u4ee5\u5916\u306e\u5834\u5408\u306f\u3000null \u3092\u8fd4\u3059\u3002\n<\/li>\n<li>\n<code>void OnResourceLoadComplete(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response, UrlRequestStatus status, long receivedContentLength);<\/code><br \/>\n\u30ea\u30bd\u30fc\u30b9\u306e\u8aad\u307f\u8fbc\u307f\u304c\u5b8c\u4e86\u3057\u305f\u969b\u306b\u547c\u3070\u308c\u308b\u3002\n<\/li>\n<\/ul>\n<p>\u5168\u90e8\u306714\u500b\u3042\u308a\u307e\u3059(-_-;)<br \/>\n\u305f\u3060\u3057\u4eca\u65e5\u73fe\u5728\u3001 GetResourceResponseFilter \u306f\u6700\u65b0\u306e\u30bd\u30fc\u30b9\u306b\u306f\u542b\u307e\u308c\u3066\u307e\u3059\u304c\u3001NuGet\u306e\u6700\u65b0v47.0.3\u306b\u306f\u307e\u3060\u542b\u307e\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u6b21\u306e\u5b9f\u88c5\u4f8b\u306b\u306f\u542b\u3081\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>true \u3092\u8fd4\u3059\u3053\u3068\u3067\u30ad\u30e3\u30f3\u30bb\u30eb\u3092\u8868\u73fe\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3082\u3042\u308c\u3070\u3001 false \u3092\u8fd4\u3059\u3053\u3068\u3067\u30ad\u30e3\u30f3\u30bb\u30eb\u3092\u8868\u73fe\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3082\u3042\u308a\u3001\u975e\u5e38\u306b\u5206\u304b\u308a\u3065\u3089\u3044\u611f\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u3067\u3059\u304c\u3088\u304f\u8abf\u3079\u308b\u3068\u3001 bool \u3092\u8fd4\u3059\u30e1\u30bd\u30c3\u30c9\u3067\u306f false \u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306b\u306a\u308b\u3088\u3046\u6562\u3048\u3066\u771f\u507d\u5024\u306e\u610f\u5473\u3092\u5909\u3048\u3066\u308b\u3088\u3046\u3067\u3059\u3002<br \/>\n\u3067\u3042\u308c\u3070\u3001\u3068\u306b\u304b\u304f false \u3092\u8fd4\u3057\u3066\u304a\u3051\u3070\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u52d5\u4f5c\u306b\u306a\u308b\u308f\u3051\u3067\u3059\u304b\u3089\u3042\u308b\u610f\u5473\u5206\u304b\u308a\u3084\u3059\u3044\u3068\u3082\u3044\u3048\u307e\u3059\u3002<br \/>\n\uff08\u79c1\u304c\u8a2d\u8a08\u3059\u308b\u3068\u304d\u306b\u771f\u4f3c\u3057\u305f\u3044\u3068\u306f\u601d\u308f\u306a\u3044\u3051\u3069\uff09<\/p>\n<p>\u305d\u308c\u3068\u30e1\u30bd\u30c3\u30c9\u306e\u540d\u524d\u304c\u8fd4\u308a\u5024\u306b\u3064\u3044\u3066\u8aac\u660e\u3059\u308b\u3088\u3046\u306a\u3082\u306e\u306b\u306a\u3063\u3066\u306a\u3044\u306e\u3082\u3064\u3089\u3044\u3067\u3059\u3002<br \/>\n\u3067\u3059\u304c\u3053\u308c\u3082\u3001\u300c\u30e1\u30bd\u30c3\u30c9\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u300d\u3067\u306f\u306a\u304f\u300c\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u300d\u3068\u8003\u3048\u308c\u3070\u7406\u89e3\u3067\u304d\u307e\u3059\u3002<br \/>\n\uff08\u79c1\u304c\u8a2d\u8a08\u3059\u308b\u3068\u304d\u306f\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u3092\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3067\u5b9a\u7fa9\u3057\u3088\u3046\u3068\u306f\u601d\u308f\u306a\u3044\u3051\u3069\uff09<\/p>\n<h3>IRequestHandler \u3092\u5b9f\u88c5\u3059\u308b\u6700\u4f4e\u9650\u306e\u30af\u30e9\u30b9<\/h3>\n<p>\u4ee5\u4e0a\u3092\u8e0f\u307e\u3048\u305f\u300c\u307c\u304f\u306e\u8003\u3048\u305f\u6700\u5f31\u306e\u5b9f\u88c5\u300d\u3067\u3059\u3002<br \/>\n\u3053\u308c\u3060\u3051\u3067\u306f\u4f55\u3082\u3057\u306a\u3044\u610f\u5473\u306e\u306a\u3044\u30af\u30e9\u30b9\u3067\u3059\u304c\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u95a2\u9023\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3092\u884c\u3046\u305f\u3081\u306e\u30b9\u30bf\u30fc\u30c8\u5730\u70b9\u3068\u306a\u308b\u30af\u30e9\u30b9\u3067\u3059\u3002<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nusing CefSharp;\r\n\r\nnamespace MyCefSharpTest\r\n{\r\n    class MyRequestHandler : IRequestHandler\r\n    {\r\n        bool IRequestHandler.OnBeforeBrowse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, bool isRedirect)\r\n        {\r\n            return false;\r\n        }\r\n\r\n        bool IRequestHandler.OnOpenUrlFromTab(IWebBrowser browserControl, IBrowser browser, IFrame frame, string targetUrl, WindowOpenDisposition targetDisposition, bool userGesture)\r\n        {\r\n            return false;\r\n        }\r\n\r\n        bool IRequestHandler.OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback)\r\n        {\r\n            return false;\r\n        }\r\n\r\n        void IRequestHandler.OnPluginCrashed(IWebBrowser browserControl, IBrowser browser, string pluginPath)\r\n        {\r\n        }\r\n\r\n        CefReturnValue IRequestHandler.OnBeforeResourceLoad(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IRequestCallback callback)\r\n        {\r\n            return CefReturnValue.Continue;\r\n        }\r\n\r\n        bool IRequestHandler.GetAuthCredentials(IWebBrowser browserControl, IBrowser browser, IFrame frame, bool isProxy, string host, int port, string realm, string scheme, IAuthCallback callback)\r\n        {\r\n            callback.Dispose();\r\n            return false;\r\n        }\r\n        void IRequestHandler.OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status)\r\n        {\r\n        }\r\n\r\n        bool IRequestHandler.OnQuotaRequest(IWebBrowser browserControl, IBrowser browser, string originUrl, long newSize, IRequestCallback callback)\r\n        {\r\n            return false;\r\n        }\r\n\r\n        void IRequestHandler.OnResourceRedirect(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, ref string newUrl)\r\n        {\r\n        }\r\n\r\n        bool IRequestHandler.OnProtocolExecution(IWebBrowser browserControl, IBrowser browser, string url)\r\n        {\r\n            return false;\r\n        }\r\n\r\n        void IRequestHandler.OnRenderViewReady(IWebBrowser browserControl, IBrowser browser)\r\n        {\r\n        }\r\n\r\n        bool IRequestHandler.OnResourceResponse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response)\r\n        {\r\n            return false;\r\n        }\r\n\r\n        void IRequestHandler.OnResourceLoadComplete(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response, UrlRequestStatus status, long receivedContentLength)\r\n        {\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p>\u3053\u3046\u3084\u3063\u3066\u307e\u3068\u3081\u3066\u898b\u308b\u3068\u3001\u57fa\u672c\u7684\u306b void \u306a\u30e1\u30bd\u30c3\u30c9\u306f\u7a7a\u306b\u3001 bool \u306a\u30e1\u30bd\u30c3\u30c9\u306f false \u3092\u8fd4\u3059\u3088\u3046\u306b\u3001 CefReturnValue \u306a\u30e1\u30bd\u30c3\u30c9\u306f\u3000CefReturnValue.Continue \u3092\u8fd4\u3059\u3088\u3046\u306b\u3057\u305f\u3060\u3051\u3067\u3059\u306d\u3002<br \/>\nGetAuthCredentials \u3060\u3051\u306f callback.Dispose(); \u306e\u884c\u304c\u8ffd\u52a0\u3055\u308c\u3066\u307e\u3059\u304c\u3001\u3053\u308c\u306f\u516c\u5f0f\u306e\u30b5\u30f3\u30d7\u30eb\u306e\u30bd\u30fc\u30b9\u4e2d\u306b\u305d\u3046\u3059\u308b\u3088\u3046\u306b\u304a\u3059\u3059\u3081\u3059\u308b\u3068\u30b3\u30e1\u30f3\u30c8\u304c\u66f8\u304b\u308c\u3066\u3044\u305f\u305f\u3081\u305d\u3046\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u7d42\u308f\u3063\u3066\u307f\u308c\u3070\u7c21\u5358\u306a\u4e8b\u3067\u3059\u304c\u3001\u6700\u521d\u306f\u300c\u3053\u308c\u3060\u3051\u306e\u30e1\u30bd\u30c3\u30c9\u3069\u3046\u3084\u3063\u3066\u5b9f\u88c5\u3059\u308b\u3093\u3060\u2026\u300d\u3068\u8efd\u304f\u9014\u65b9\u306b\u66ae\u308c\u307e\u3057\u305f\u3002<br \/>\n\u4e00\u3064\u306e\u30e1\u30bd\u30c3\u30c9\uff08\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\uff09\u3092\u30ab\u30b9\u30bf\u30e0\u3057\u305f\u3044\u3060\u3051\u306a\u306e\u306b\u3001\u591a\u6570\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u3072\u3068\u3064\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u306b\u307e\u3068\u307e\u3063\u3066\u308b\u304c\u305f\u3081\u306b\u5168\u90e8\u5b9f\u88c5\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u306e\u306f\u3001\u3069\u3046\u5b9f\u88c5\u3059\u308b\u304b\u5206\u304b\u3063\u305f\u4eca\u3067\u3082\u9762\u5012\u306a\u611f\u3058\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u79c1\u306f OnBeforeBrowse \u306e\u30ab\u30b9\u30bf\u30e0\u3092\u76ee\u7684\u3068\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u4ed6\u306e\u30c6\u30af\u30ce\u30ed\u30b8\u3067\u3042\u308c\u3070\u540c\u3058\u3088\u3046\u306a\u30a4\u30d9\u30f3\u30c8\u304c\u30d6\u30e9\u30a6\u30b6\u306b\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u7c21\u5358\u306b\u30ab\u30b9\u30bf\u30e0\u3067\u304d\u308b\u3093\u3067\u3059\u3088\u306d\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067 IRequestHandler \u3092\u5b9f\u88c5\u3057\u3088\u3046\u3068\u3057\u305f\u3089\u30e1\u30bd\u30c3\u30c9\u304c\u591a\u3059\u304e\u3066\u9014\u65b9\u306b\u66ae\u308c\u305f\u65b9\u306f\u662f\u975e\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\uff08\u3042\u307e\u308a\u5c45\u306a\u3044\u304b\u306a\uff1fw\uff09<\/p>\n<h4>\u53c2\u8003: \u4ed6\u306e\u30c6\u30af\u30ce\u30ed\u30b8\u306b\u304a\u3044\u3066 OnBeforeBrowse \u30a4\u30d9\u30f3\u30c8\u306b\u76f8\u5f53\u3059\u308b\u30a4\u30d9\u30f3\u30c8<\/h4>\n<table>\n<tr>\n<td>\u30c6\u30af\u30ce\u30ed\u30b8<\/td>\n<td>\u30d6\u30e9\u30a6\u30b6\u30af\u30e9\u30b9<\/td>\n<td>\u30a4\u30d9\u30f3\u30c8<\/td>\n<\/tr>\n<tr>\n<td>Windows Forms<\/td>\n<td>System.Windows.Forms.WebBrowser<\/td>\n<td>Navigating<\/td>\n<\/tr>\n<tr>\n<td>UWP<\/td>\n<td>Windows.UI.Xaml.Controls.WebView<\/td>\n<td>NavigationStarting<\/td>\n<\/tr>\n<tr>\n<td>Geckofx<\/td>\n<td>Gecko.GeckoWebBrowser<\/td>\n<td>Navigating<\/td>\n<\/tr>\n<\/table>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[563,562],"class_list":["post-4672","post","type-post","status-publish","format-standard","hentry","category-tech","tag-csharp","tag-cefsharp"],"_links":{"self":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts\/4672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/comments?post=4672"}],"version-history":[{"count":0,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts\/4672\/revisions"}],"wp:attachment":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/media?parent=4672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/categories?post=4672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/tags?post=4672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}