1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-04 08:34:07 +02:00

Apply default background color only to Twitter and TweetDeck websites

This commit is contained in:
chylex 2021-12-24 15:58:19 +01:00
parent ccb87351c1
commit 7de0c50387
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548

View File

@ -76,8 +76,6 @@ public TweetDeckBrowser(FormBrowser owner, PluginManager plugins, TweetDeckBridg
this.browser.RegisterJsBridge("$TD", tdBridge);
this.browser.RegisterJsBridge("$TDU", updateBridge);
// ReSharper disable once PossiblyImpureMethodCallOnReadonlyVariable
this.browser.BrowserSettings.BackgroundColor = (uint) TwitterUtils.BackgroundColor.ToArgb();
this.browser.Dock = DockStyle.None;
this.browser.Location = ControlExtensions.InvisibleLocation;
this.browser.SetupZoomEvents();
@ -135,7 +133,7 @@ private void browser_FrameLoadStart(object sender, FrameLoadStartEventArgs e) {
if (frame.IsMain) {
string url = frame.Url;
if (!TwitterUrls.IsTwitterLogin2Factor(url)) {
if (TwitterUrls.IsTweetDeck(url) || (TwitterUrls.IsTwitter(url) && !TwitterUrls.IsTwitterLogin2Factor(url))) {
frame.ExecuteJavaScriptAsync(TwitterUtils.BackgroundColorOverride);
}
}