mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-08-10 12:40:35 +02:00
Move CEF argument setup to BrowserUtils
This commit is contained in:
parent
29b75d4391
commit
0fd86bf214
@ -1,5 +1,6 @@
|
||||
using CefSharp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
@ -32,6 +33,17 @@ public static string HeaderAcceptLanguage{
|
||||
"tweetdeck", "TweetDeck", "tweetduck", "TweetDuck", "TD"
|
||||
};
|
||||
|
||||
public static void SetupCefArgs(IDictionary<string, string> args){
|
||||
if (!Program.SystemConfig.HardwareAcceleration){
|
||||
args["disable-gpu"] = "1";
|
||||
args["disable-gpu-vsync"] = "1";
|
||||
}
|
||||
|
||||
args["disable-extensions"] = "1";
|
||||
args["disable-plugins-discovery"] = "1";
|
||||
args["enable-system-flash"] = "0";
|
||||
}
|
||||
|
||||
public static bool IsValidUrl(string url){
|
||||
if (Uri.TryCreate(url, UriKind.Absolute, out Uri uri)){
|
||||
string scheme = uri.Scheme;
|
||||
|
10
Program.cs
10
Program.cs
@ -152,15 +152,7 @@ private static void Main(){
|
||||
};
|
||||
|
||||
CommandLineArgsParser.ReadCefArguments(UserConfig.CustomCefArgs).ToDictionary(settings.CefCommandLineArgs);
|
||||
|
||||
if (!SystemConfig.HardwareAcceleration){
|
||||
settings.CefCommandLineArgs["disable-gpu"] = "1";
|
||||
settings.CefCommandLineArgs["disable-gpu-vsync"] = "1";
|
||||
}
|
||||
|
||||
settings.CefCommandLineArgs["disable-extensions"] = "1";
|
||||
settings.CefCommandLineArgs["disable-plugins-discovery"] = "1";
|
||||
settings.CefCommandLineArgs["enable-system-flash"] = "0";
|
||||
BrowserUtils.SetupCefArgs(settings.CefCommandLineArgs);
|
||||
|
||||
Cef.EnableHighDPISupport();
|
||||
Cef.Initialize(settings, false, new BrowserProcessHandler());
|
||||
|
Loading…
Reference in New Issue
Block a user