-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
406 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using CefSharp; | ||
using CefSharp.Handler; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Browser.CefOp | ||
{ | ||
public class CustomResourceRequestHandler : ResourceRequestHandler | ||
{ | ||
|
||
bool pixiSettingEnabled; | ||
|
||
public CustomResourceRequestHandler(bool pixiSettingEnabled) : base() | ||
{ | ||
this.pixiSettingEnabled = pixiSettingEnabled; | ||
} | ||
|
||
|
||
/// <summary> | ||
/// レスポンスの置換制御を行います。 | ||
/// </summary> | ||
protected override IResponseFilter GetResourceResponseFilter(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, IResponse response) | ||
{ | ||
if (pixiSettingEnabled && request.Url.Contains(@"/kcs2/index.php")) | ||
return new ResponseFilterPixiSetting(); | ||
|
||
return base.GetResourceResponseFilter(chromiumWebBrowser, browser, frame, request, response); | ||
} | ||
|
||
/// <summary> | ||
/// 特定の通信をブロックします。 | ||
/// </summary> | ||
protected override CefReturnValue OnBeforeResourceLoad(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, IRequestCallback callback) | ||
{ | ||
// ログイン直後に勝手に遷移させられ、ブラウザがホワイトアウトすることがあるためブロックする | ||
if (request.Url.Contains(@"/rt.gsspat.jp/")) | ||
{ | ||
return CefReturnValue.Cancel; | ||
} | ||
|
||
return base.OnBeforeResourceLoad(chromiumWebBrowser, browser, frame, request, callback); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="cef.redist.x64" version="73.1.13" targetFramework="net452" /> | ||
<package id="cef.redist.x86" version="73.1.13" targetFramework="net452" /> | ||
<package id="CefSharp.Common" version="73.1.130" targetFramework="net452" /> | ||
<package id="CefSharp.WinForms" version="73.1.130" targetFramework="net452" /> | ||
<package id="cef.redist.x64" version="79.1.36" targetFramework="net452" /> | ||
<package id="cef.redist.x86" version="79.1.36" targetFramework="net452" /> | ||
<package id="CefSharp.Common" version="79.1.360" targetFramework="net452" /> | ||
<package id="CefSharp.WinForms" version="79.1.360" targetFramework="net452" /> | ||
<package id="log4net" version="2.0.8" targetFramework="net452" /> | ||
<package id="Nekoxy" version="1.5.3.21" targetFramework="net45" /> | ||
</packages> |
Oops, something went wrong.