diff --git a/WebAssemblyViewer/BrowserOptions.cs b/WebAssemblyViewer/BrowserOptions.cs
index d82c508..5406ee1 100644
--- a/WebAssemblyViewer/BrowserOptions.cs
+++ b/WebAssemblyViewer/BrowserOptions.cs
@@ -17,6 +17,7 @@ public class BrowserOptions
public bool TopMost { get; set; }
public bool DisableF4 { get; set; }
+ public bool EnableF4Password { get; set; }
public string DisableF4Password { get; set; }
diff --git a/WebAssemblyViewer/BrowserWindow.cs b/WebAssemblyViewer/BrowserWindow.cs
index 70ab6d2..9a47e9f 100644
--- a/WebAssemblyViewer/BrowserWindow.cs
+++ b/WebAssemblyViewer/BrowserWindow.cs
@@ -156,19 +156,23 @@ private void OnAcceleratorKeyPressedF4(object sender, AcceleratorKeyPressedEvent
if (e.KeyVentType == KeyEventType.SystemKeyDown && e.VirtualKey == VirtualKeys.VK_F4)
{
- if (this._Options.DisableF4)
+ if (this._Options.DisableF4 )
{
- Diga.Core.Threading.UIDispatcher.UIThread.Post(() =>
+ if (this._Options.EnableF4Password)
{
- DOMWindow win = this._Browser.GetDOMWindow();
-
- string val = win.prompt("Enter your Password!","");
- val = val.Replace("\"", "");
- if (val == this._Options.DisableF4Password)
+ Diga.Core.Threading.UIDispatcher.UIThread.Post(() =>
{
- this.Close();
- }
- });
+ DOMWindow win = this._Browser.GetDOMWindow();
+
+ string val = win.prompt("Enter your Password!","");
+ val = val.Replace("\"", "");
+ if (val == this._Options.DisableF4Password)
+ {
+ this.Close();
+ }
+ });
+
+ }
e.Handled = true;
diff --git a/WebAssemblyViewer/EditWindow.cs b/WebAssemblyViewer/EditWindow.cs
index 665c2e6..c0b7df2 100644
--- a/WebAssemblyViewer/EditWindow.cs
+++ b/WebAssemblyViewer/EditWindow.cs
@@ -16,6 +16,7 @@ class EditWindow : NativeWindow
private NativeCheckBox _ChkTopMost;
private NativeCheckBox _ChkMaximized;
private NativeCheckBox _ChkDisableF4;
+ private NativeCheckBox _ChkEnableF4WithPw;
private NativeTextBox _TxtDisableF4Password;
private NativeTextBox _TxtMonitoringUlr;
private NativeTextBox _TxtUserDataFolder;
@@ -55,6 +56,7 @@ private void ViewToOptions()
this._Options.BrowserUserDataFolder = this._TxtUserDataFolder.Text;
this._Options.BrowserExecutableFolder = this._TxtBrowserExecutable.Text;
this._Options.DisableF4 = this._ChkDisableF4.Checked;
+ this._Options.EnableF4Password = this._ChkEnableF4WithPw.Checked;
this._Options.DisableF4Password = this._TxtDisableF4Password.Text;
}
@@ -74,6 +76,7 @@ private void OptionsToView()
this._ChkTopMost.Checked = this._Options.TopMost;
this._ChkMaximized.Checked = this._Options.Maximized;
this._ChkDisableF4.Checked = this._Options.DisableF4;
+ this._ChkEnableF4WithPw.Checked = this._Options.EnableF4Password;
this._TxtDisableF4Password.Text = this._Options.DisableF4Password;
}
@@ -154,18 +157,28 @@ protected override void InitControls()
this._ChkDisableF4 = new NativeCheckBox()
{
Location = new Point(chkLeft, top),
- Width = chkWidth,
+ Width = chkWidth ,
Height = textHeight,
Text = "Disable F4"
};
chkLeft += this._ChkDisableF4.Width + 10;
+
+ this._ChkEnableF4WithPw = new NativeCheckBox()
+ {
+ Location = new Point(chkLeft, top),
+ Width = chkWidth,
+ Height = textHeight,
+ Text = "PW Enable F4"
+ };
+ chkLeft += this._ChkEnableF4WithPw.Width + 10;
this._TxtDisableF4Password = new NativeTextBox
{
Location = new Point(chkLeft, top),
Width = chkWidth * 2,
Height = textHeight,
- Text = ""
+ Text = "",
+
};
this._TxtDisableF4Password.Style |= EditBoxStyles.ES_PASSWORD | WindowStylesConst.WS_BORDER;
@@ -355,6 +368,7 @@ protected override void InitControls()
this.Controls.Add(this._ChkTopMost);
this.Controls.Add(this._ChkMaximized);
this.Controls.Add(this._ChkDisableF4);
+ this.Controls.Add(this._ChkEnableF4WithPw);
this.Controls.Add(this._TxtDisableF4Password);
this.Controls.Add(lblTitle);
this.Controls.Add(this._TxtTitle);
diff --git a/WebAssemblyViewer/WebAssemblyViewer.csproj b/WebAssemblyViewer/WebAssemblyViewer.csproj
index b7776ec..98f2845 100644
--- a/WebAssemblyViewer/WebAssemblyViewer.csproj
+++ b/WebAssemblyViewer/WebAssemblyViewer.csproj
@@ -7,8 +7,8 @@
app.manifest
App.ico
AnyCPU
- 1.0.1.1
- 1.0.1.1
+ 1.0.1.2
+ 1.0.1.2