New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 641181 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Feature



Sign in to add a comment

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?
 
Cc: ranjitkan@chromium.org
Status: Untriaged (was: Unconfirmed)
New Feature Request, Untriaging it so that it gets addressed.

Thanks.!
Components: Platform>Apps>BrowserTag
Cc: rdevlin....@chromium.org lazyboy@chromium.org
Components: Platform>Extensions>API
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.
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