protected override void OnBeforeContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams state, CefMenuModel model) { for (var index = model.Count - 1; index >= 0; index--) { var nCmd = model.GetCommandIdAt(index); if (!ContextMenuHelper.IsEdition(nCmd) && !ContextMenuHelper.IsUserDefined(nCmd)) { model.Remove(nCmd); } } if (WinFormium.Runtime.IsDebuggingMode && (state.ContextMenuType & CefContextMenuTypeFlags.Editable) != CefContextMenuTypeFlags.Editable) { if (model.Count > 0) { model.AddSeparator(); } model.AddItem((int)((CefMenuId)ContextMenuHelper.MenuIdentifier.MENU_ID_SHOW_DEVTOOLS), Resources.Messages.ContextMenu_ShowDevTools); model.AddItem((int)((CefMenuId)ContextMenuHelper.MenuIdentifier.MENU_ID_HIDE_DEVTOOLS), Resources.Messages.ContextMenu_CloseDevTools); } var e = new BeforeContextMenuEventArgs(frame, state, model); _owner.InvokeIfRequired(() => _owner.OnBeforeContextMenu(e)); }