CEF Debug 增加 开发工具

删除 From 消息
This commit is contained in:
chfei committed 2026-08-21 14:14:47 +08:00
1 parent 772ee833c8
commit 5456e6611d
1 file changed
+16 -4
+16 -4
View File
@@ -91,6 +91,10 @@ namespace Work._29Tools.CefTools
model.AddItem((CefMenuCommand)menu.CommandCode, menu.CommandText); model.AddItem((CefMenuCommand)menu.CommandCode, menu.CommandText);
} }
} }
#if DEBUG
model.AddSeparator();
model.AddItem((CefMenuCommand)99990, "开发者工具");
#endif
} }
public bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags) public bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags)
@@ -101,11 +105,11 @@ namespace Work._29Tools.CefTools
if (!string.IsNullOrEmpty(url)) if (!string.IsNullOrEmpty(url))
{ {
Clipboard.SetText(url); Clipboard.SetText(url);
BaseMsgTipFormHelper.ShowInfo("复制页面地址到剪贴板成功"); //BaseMsgTipFormHelper.ShowInfo("复制页面地址到剪贴板成功");
} }
else else
{ {
BaseMsgTipFormHelper.ShowError("复制页面地址到剪贴板失败"); //BaseMsgTipFormHelper.ShowError("复制页面地址到剪贴板失败");
} }
return true; return true;
} }
@@ -116,11 +120,11 @@ namespace Work._29Tools.CefTools
if (!string.IsNullOrEmpty(url)) if (!string.IsNullOrEmpty(url))
{ {
Clipboard.SetText(url); Clipboard.SetText(url);
BaseMsgTipFormHelper.ShowInfo("复制图片地址到剪贴板成功"); //BaseMsgTipFormHelper.ShowInfo("复制图片地址到剪贴板成功");
} }
else else
{ {
BaseMsgTipFormHelper.ShowError("复制图片地址到剪贴板失败"); //BaseMsgTipFormHelper.ShowError("复制图片地址到剪贴板失败");
} }
return true; return true;
} }
@@ -233,6 +237,14 @@ namespace Work._29Tools.CefTools
} }
} }
#if DEBUG
if (commandId == (CefMenuCommand)99990)
{
browser.ShowDevTools();
return true;
}
#endif
// Return false should ignore the selected option of the user ! // Return false should ignore the selected option of the user !
return false; return false;
} }