1
0
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:
chylex 2017-06-29 03:52:55 +02:00
parent 29b75d4391
commit 0fd86bf214
2 changed files with 13 additions and 9 deletions

View File

@ -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;

View File

@ -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());