--debug, tray launch DevTools, fix right click paste

This commit is contained in:
Natsumi
2022-09-12 20:50:58 +12:00
parent 1e1918389b
commit 116f76a2a5
5 changed files with 38 additions and 19 deletions

View File

@@ -12,7 +12,7 @@ namespace VRCX
public void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model)
{
// remove default right click
if (!parameters.TypeFlags.HasFlag(ContextMenuType.Selection))
if (!parameters.TypeFlags.HasFlag(ContextMenuType.Selection) && !parameters.TypeFlags.HasFlag(ContextMenuType.Editable))
model.Clear();
}
@@ -23,7 +23,6 @@ namespace VRCX
public void OnContextMenuDismissed(IWebBrowser browserControl, IBrowser browser, IFrame frame)
{
}
public bool RunContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model, IRunContextMenuCallback callback)

10
MainForm.Designer.cs generated
View File

@@ -36,6 +36,7 @@ namespace VRCX
this.components = new System.ComponentModel.Container();
this.TrayMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.TrayMenu_Open = new System.Windows.Forms.ToolStripMenuItem();
this.TrayMenu_DevTools = new System.Windows.Forms.ToolStripMenuItem();
this.TrayMenu_Separator = new System.Windows.Forms.ToolStripSeparator();
this.TrayMenu_Quit = new System.Windows.Forms.ToolStripMenuItem();
this.TrayIcon = new System.Windows.Forms.NotifyIcon(this.components);
@@ -46,6 +47,7 @@ namespace VRCX
//
this.TrayMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.TrayMenu_Open,
this.TrayMenu_DevTools,
this.TrayMenu_Separator,
this.TrayMenu_Quit});
this.TrayMenu.Name = "TrayMenu";
@@ -58,6 +60,13 @@ namespace VRCX
this.TrayMenu_Open.Text = "Open";
this.TrayMenu_Open.Click += new System.EventHandler(this.TrayMenu_Open_Click);
//
// TrayMenu_DevTools
//
this.TrayMenu_DevTools.Name = "TrayMenu_DevTools";
this.TrayMenu_DevTools.Size = new System.Drawing.Size(131, 22);
this.TrayMenu_DevTools.Text = "DevTools";
this.TrayMenu_DevTools.Click += new System.EventHandler(this.TrayMenu_DevTools_Click);
//
// TrayMenu_Separator
//
this.TrayMenu_Separator.Name = "TrayMenu_Separator";
@@ -100,6 +109,7 @@ namespace VRCX
private System.Windows.Forms.ContextMenuStrip TrayMenu;
private System.Windows.Forms.ToolStripMenuItem TrayMenu_Open;
private System.Windows.Forms.ToolStripMenuItem TrayMenu_DevTools;
private System.Windows.Forms.ToolStripSeparator TrayMenu_Separator;
private System.Windows.Forms.ToolStripMenuItem TrayMenu_Quit;
private System.Windows.Forms.NotifyIcon TrayIcon;

View File

@@ -54,7 +54,8 @@ namespace VRCX
Browser.IsBrowserInitializedChanged += (A, B) =>
{
// Browser.ShowDevTools();
if (Program.LaunchDebug)
Browser.ShowDevTools();
};
Util.ApplyJavascriptBindings(Browser.JavascriptObjectRepository);
@@ -166,6 +167,11 @@ namespace VRCX
Focus();
}
private void TrayMenu_DevTools_Click(object sender, System.EventArgs e)
{
Instance.Browser.ShowDevTools();
}
private void TrayMenu_Quit_Click(object sender, System.EventArgs e)
{
Application.Exit();

View File

@@ -15,6 +15,7 @@ namespace VRCX
public static string BaseDirectory { get; private set; }
public static string AppDataDirectory { get; private set; }
public static string ConfigLocation;
public static bool LaunchDebug;
static Program()
{

View File

@@ -27,8 +27,11 @@ namespace VRCX
if (arg.Length > 12 && arg.Substring(0, 12) == "/uri=vrcx://")
LaunchCommand = arg.Substring(12);
if (arg.Length > 12 && arg.Substring(0, 8) == "--config")
if (arg.Length > 8 && arg.Substring(0, 8) == "--config")
Program.ConfigLocation = arg.Substring(9);
if (arg.Length >= 7 && arg.Substring(0, 7) == "--debug")
Program.LaunchDebug = true;
}
if (processList.Length > 1 && String.IsNullOrEmpty(LaunchCommand))