Browse Source

增加京东响应速度

master
С·æ 4 years ago
parent
commit
c39d12fe78
  1. 9
      客户端/齐越慧眼/齐越慧眼/App.xaml.cs
  2. 16
      客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs

9
客户端/齐越慧眼/齐越慧眼/App.xaml.cs

@ -20,11 +20,14 @@ namespace 齐越慧眼
public App() { public App() {
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
var settings = new CefSettings() { var settings = new CefSettings() {
CachePath = System.Environment.CurrentDirectory + "\\webDatas\\data", // CachePath = System.Environment.CurrentDirectory + "\\webDatas\\data",
// LocalesDirPath = System.Environment.CurrentDirectory + "\\webDatas", // LocalesDirPath = System.Environment.CurrentDirectory + "\\webDatas",
RootCachePath= System.Environment.CurrentDirectory + "\\rootCache", // RootCachePath= System.Environment.CurrentDirectory + "\\rootCache",
UserAgent= "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36 SE 2.X MetaSr 1.0", UserAgent= "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36 SE 2.X MetaSr 1.0",
Locale= "zh-CN" Locale= "zh-CN",
// AutoDetectProxySettings = false,
// PackLoadingDisabled = true,
// LogSeverity = LogSeverity.Disable
}; };
// ... // ...

16
客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs

@ -18,22 +18,20 @@ namespace 齐越慧眼.UserControls
{ {
public static BrowerControl Main = null; public static BrowerControl Main = null;
static MyRequestHandler myRequest; public ExtChromiumBrowser web;
public ChromiumWebBrowser web;
public BrowerControl() public BrowerControl()
{ {
InitializeComponent(); InitializeComponent();
myRequest = new MyRequestHandler() { brower=this}; web = new ExtChromiumBrowser("https://www.taobao.com")
web = new ChromiumWebBrowser("https://www.taobao.com")
{ {
BrowserSettings = BrowserSettings =
{ {
DefaultEncoding = "UTF-8", DefaultEncoding = "UTF-8",
Plugins = CefState.Enabled, // Plugins = CefState.Enabled,
//关于跨域限制 //关于跨域限制
//WebSecurity = CefState.Disabled, //WebSecurity = CefState.Disabled,
ApplicationCache = CefState.Enabled, // ApplicationCache = CefState.Enabled,
LocalStorage = CefState.Enabled // LocalStorage = CefState.Enabled
}, },
// RequestHandler = myRequest // RequestHandler = myRequest
@ -47,7 +45,7 @@ namespace 齐越慧眼.UserControls
web.JavascriptObjectRepository.Register("hyCoreModel", new CefAsyncJS(), BindingOptions.DefaultBinder); web.JavascriptObjectRepository.Register("hyCoreModel", new CefAsyncJS(), BindingOptions.DefaultBinder);
Main = this; Main = this;
// web.StartNewWindow += Web_StartNewWindow; web.StartNewWindow += Web_StartNewWindow;
} }
@ -106,7 +104,7 @@ namespace 齐越慧眼.UserControls
{ {
StartPage(); StartPage();
} }
web.ShowDevTools(); // web.ShowDevTools();
} }
} }

Loading…
Cancel
Save