1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-08-18 22:24:53 +02:00
Files
Configuration
Core
Bridge
Controls
Handling
General
BrowserProcessHandler.cs
FileDialogHandler.cs
JavaScriptDialogHandler.cs
LifeSpanHandler.cs
ContextMenuBase.cs
ContextMenuBrowser.cs
ContextMenuGuide.cs
ContextMenuNotification.cs
DragHandlerBrowser.cs
KeyboardHandlerBrowser.cs
KeyboardHandlerNotification.cs
RequestHandlerBase.cs
RequestHandlerBrowser.cs
ResourceHandlerNotification.cs
Management
Notification
Other
Utils
FormBrowser.Designer.cs
FormBrowser.cs
FormBrowser.resx
FormManager.cs
TweetDeckBrowser.cs
Data
Plugins
Properties
Resources
Updates
bld
lib
subprocess
tests
video
.gitattributes
.gitignore
LICENSE.md
Program.cs
README.md
Reporter.cs
TweetDuck.csproj
TweetDuck.sln
TweetDuck.sln.DotSettings
packages.config
TweetDuck/Core/Handling/General/BrowserProcessHandler.cs

27 lines
1.0 KiB
C#

using System;
using System.Threading.Tasks;
using CefSharp;
namespace TweetDuck.Core.Handling.General{
sealed class BrowserProcessHandler : IBrowserProcessHandler{
public static Task UpdatePrefs(){
return Cef.UIThreadTaskFactory.StartNew(UpdatePrefsInternal);
}
private static void UpdatePrefsInternal(){
using(IRequestContext ctx = Cef.GetGlobalRequestContext()){
ctx.SetPreference("browser.enable_spellchecking", Program.UserConfig.EnableSpellCheck, out string _);
ctx.SetPreference("spellcheck.dictionary", Program.UserConfig.SpellCheckLanguage, out string _);
ctx.SetPreference("settings.a11y.animation_policy", Program.UserConfig.EnableAnimatedImages ? "allowed" : "none", out string _);
}
}
void IBrowserProcessHandler.OnContextInitialized(){
UpdatePrefsInternal();
}
void IBrowserProcessHandler.OnScheduleMessagePumpWork(long delay){}
void IDisposable.Dispose(){}
}
}