2
我試圖創建一個父菜單項下的子上下文菜單項的錯誤,並測試了下面的代碼:這是Chrome擴展上下文菜單
chrome.contextMenus.create(
{'title': 'child1', 'parentId': parentItem, 'onclick': function(info,tab){console.log('info', info)}}
)
此代碼返回317
,這是子項ID,並檢查上下文菜單後,該子項「child1」下「parentItem」的確創造了,但是當我點擊「child1」,該console.log
顯示
info Object
editable: false
menuItemId: 317
pageUrl: "https://www.google.com/"
parentMenuItemId: 317
的「parentMenuItemId」是一樣的作爲'menuItemId',而不是parentItem
,這不是317
。
這是怎麼回事?我錯過了什麼嗎?
它應該在下一個開發通道版本的Chrome 25中修復。 – yoz