Skip to content

Commit 6d33dee

Browse files
committed
Browser code relocation...
1 parent 9b8c9dd commit 6d33dee

File tree

2 files changed

+19
-23
lines changed

2 files changed

+19
-23
lines changed

External/Plugins/StartPage/PluginMain.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
using ProjectManager;
1313
using StartPage.Controls;
1414
using WeifenLuo.WinFormsUI.Docking;
15-
using Microsoft.Win32;
1615

1716
namespace StartPage
1817
{
@@ -102,7 +101,6 @@ public void Initialize()
102101
this.InitBasics();
103102
this.LoadSettings();
104103
this.AddEventHandlers();
105-
this.UseLatestBrowserControl();
106104
this.CreateMenuItem();
107105
}
108106

@@ -198,24 +196,6 @@ public void AddEventHandlers()
198196
EventManager.AddEventHandler(this, EventType.RestoreSession);
199197
}
200198

201-
/// <summary>
202-
/// Sets a key in registry so that latest .NET browser control is used
203-
/// </summary>
204-
private void UseLatestBrowserControl()
205-
{
206-
try
207-
{
208-
String valueName = DistroConfig.DISTRIBUTION_NAME + ".exe";
209-
String subKey = "Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION\\";
210-
RegistryKey emu = Registry.CurrentUser.OpenSubKey(subKey, true);
211-
{
212-
Object value = emu.GetValue(valueName);
213-
if (value == null) emu.SetValue(valueName, 0, RegistryValueKind.DWord);
214-
}
215-
}
216-
catch {} // No errors please...
217-
}
218-
219199
/// <summary>
220200
/// Loads the plugin settings
221201
/// </summary>

FlashDevelop/Controls/Browser.cs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
using System;
2-
using System.Text;
32
using System.Drawing;
43
using System.Windows.Forms;
54
using System.ComponentModel;
6-
using System.Collections.Generic;
75
using PluginCore.Localization;
8-
using PluginCore.Controls;
96
using PluginCore.Helpers;
107
using PluginCore;
8+
using Microsoft.Win32;
9+
using System.Reflection;
10+
using System.IO;
1111

1212
namespace FlashDevelop.Controls
1313
{
@@ -21,6 +21,22 @@ public class Browser : UserControl
2121
private System.Windows.Forms.ToolStripSpringComboBox addressComboBox;
2222
private FlashDevelop.Controls.WebBrowserEx webBrowser;
2323

24+
static Browser()
25+
{
26+
try
27+
{
28+
// Sets a key in registry so that latest .NET browser control is used
29+
String valueName = Path.GetFileName(Application.ExecutablePath);
30+
String subKey = "Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION\\";
31+
RegistryKey emu = Registry.CurrentUser.OpenSubKey(subKey, true);
32+
{
33+
Object value = emu.GetValue(valueName);
34+
if (value == null) emu.SetValue(valueName, 0, RegistryValueKind.DWord);
35+
}
36+
}
37+
catch { } // No errors please...
38+
}
39+
2440
public Browser()
2541
{
2642
this.Font = Globals.Settings.DefaultFont;

0 commit comments

Comments
 (0)