public override void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model) { if (!TwitterUrls.IsTweetDeck(frame.Url) || browser.IsLoading) { extraContext.Reset(); } base.OnBeforeContextMenu(browserControl, browser, frame, parameters, model); bool isSelecting = parameters.TypeFlags.HasFlag(ContextMenuType.Selection); bool isEditing = parameters.TypeFlags.HasFlag(ContextMenuType.Editable); if (!isSelecting && !isEditing) { AddSeparator(model); IMenuModel globalMenu = model.Count == 0 ? model : model.AddSubMenu(MenuGlobal, Program.BrandName); globalMenu.AddItem(CefMenuCommand.Reload, TitleReloadBrowser); globalMenu.AddCheckItem(MenuMute, TitleMuteNotifications); globalMenu.SetChecked(MenuMute, Config.MuteNotifications); globalMenu.AddSeparator(); globalMenu.AddItem(MenuSettings, TitleSettings); globalMenu.AddItem(MenuPlugins, TitlePlugins); globalMenu.AddItem(MenuAbout, TitleAboutProgram); AddDebugMenuItems(globalMenu); } }
protected override void OnBeforeContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams state, CefMenuModel model) { if (!TwitterUrls.IsTweetDeck(frame.Url) || browser.IsLoading) { extraContext.Reset(); } base.OnBeforeContextMenu(browser, frame, state, model); }