1

I am trying to change the text in the contextMenu when right clicked, but it doesnt work. Here is what I have so far. Any ideas?

function getword(info,tab) {
    chrome.contextMenus.update('contextMenuId', {
        title: "New text"
    });
}

chrome.contextMenus.create({
    'id': 'contextMenuId',
    title: "First text",
    contexts:["selection"],
    onclick: getword
});
misterdh
  • 73
  • 7
  • If you want to change it inside onclick handler, it'll work only for the next invocation of the menu. In Chrome you need to use a content script as [shown here](https://stackoverflow.com/a/13673942). – wOxxOm Apr 24 '18 at 04:15

0 Answers0