Chrome extension > contextMenus Api > can not add onclick handler

前端 未结 1 1936
醉梦人生
醉梦人生 2020-12-20 06:37

I am trying to create a chrome extension. Currently I am about to create context menu for my extension, which will do something when I click on it. So, following google docu

相关标签:
1条回答
  • 2020-12-20 07:20

    Event based background pages (persistent=false) have to use chrome.contextMenus.onClicked listeners.

    chrome.contextMenus.create({...});
    chrome.contextMenus.onClicked.addListener(function(info, tab) {
        alert("bla bla bla");
    });
    
    0 讨论(0)
提交回复
热议问题