Chrome webapp/webview api request for onBeforeShow event
Reported by
princeto...@gmail.com,
Aug 26 2016
|
|||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Steps to reproduce the problem:
Using following code frag to modify "enabled" property of contextMenu item: (el is a webview in some context)
this.el.contextMenus.onShow.addListener(function () {
this.el.contextMenus.update("nav:back", { enabled: this.el.canGoBack() });
this.el.contextMenus.update("nav:forward", { enabled: this.el.canGoForward() });
}.bind(this));
What is the expected behavior?
Context menu will disable nav-forward or nav-back action choice if it cannot be performed.
What went wrong?
onShow fires after menu is already rendered;
changes to enabled appear the next time the contextMenu is shown.
Did this work before? No
Chrome version: 52.0.2743.116 Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 22.0 r0
Would be nice to have onBeforeShow event handling to modify contextMenu before its shown. Am I missing something?
,
Feb 12 2018
,
Feb 12 2018
From my initial look it doesn't look like chrome.contextMenus supports this either: https://developer.chrome.com/apps/contextMenus I could see possibly adding it for WebView if it was supported for extensions/apps in general. Adding extensions folks for further input.
,
Feb 13 2018
I think we've talked about this in the past, and one of the biggest concerns here is the possibility for visible lag between the user right-clicking and the context menu popping up. Since the methods need to be asynchronous (the extension runs in another process from the menu), it'd be hard to reasonably ensure speed and responsiveness. For better or worse, our advice is usually that the context menu should be ready to display in advance, so that we don't create visible jank. Doing this explicitly in a webview might be more acceptable, since the webview is entirely the app's experience, but I'd still be hesitant. |
|||
►
Sign in to add a comment |
|||
Comment 1 by ranjitkan@chromium.org
, Aug 26 2016Status: Untriaged (was: Unconfirmed)