What I want to do is:
if the user does not select anything, display menu item A;
if the user selects something, display menu item B.
So far what I can get is:
if the user does not select anything, display menu item A;
if the user selects something, display both A and B.
I want to know:
how to make item A disappear when there is selection?
Many thanks!
Below is my code:
var all = chrome.contextMenus.create
({
"title": "A",
"contexts":["page"],
"onclick": doA
});
var selection = chrome.contextMenus.create
({
"title": "B",
"contexts":["selection"],
"onclick": doB
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…