2012-10-01 106 views
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

這是怎麼回事?我錯過了什麼嗎?

回答

3

是的,這是一個錯誤。我已經將它報告爲crbug.com/165771,但未來最好在crbug.com/new上報告錯誤(或疑似錯誤),以便有人能夠更快地看到它們。

+1

它應該在下一個開發通道版本的Chrome 25中修復。 – yoz

相關問題