chaohuang
chaohuang

Reputation: 4115

Is this a bug of the chrome extension context menu

I was trying to create a child context menu item under a parent menu item, and tested the following code:

  chrome.contextMenus.create(
     {'title': 'child1', 'parentId': parentItem, 'onclick': function(info,tab){console.log('info', info)}}
  )

This code returned 317, which was the child item ID, and after checking the context menu, the child item 'child1' was indeed created under 'parentItem', but when I clicked 'child1', the console.log showed

  info  Object
  editable: false
  menuItemId: 317
  pageUrl: "https://www.google.com/"
  parentMenuItemId: 317

The 'parentMenuItemId' is the same as the 'menuItemId', not the parentItem, which is not 317.

What's going on here? Am I missing something?

Upvotes: 2

Views: 382

Answers (1)

yoz
yoz

Reputation: 952

Yes, this is a bug. I've reported it as crbug.com/165771 , but in the future it's best to report bugs (or suspected bugs) at crbug.com/new so that someone will see them sooner.

Upvotes: 3

Related Questions