目前我正在修复Chrome扩展程序。我的最后一个问题是,当一个人滚动某些内容并右键点击时,我正在尝试创建两个contextMenus。
chrome.contextMenus.create({
title: "One: '%s'",
contexts:["selection"],
id:'sat'
});
chrome.contextMenus.create({
title: "Two: '%s'",
contexts:["selection"],
id:'dat'
});
chrome.contextMenus.onClicked.addListener(function(info, tab){...
当我测试它时,它只会创建第一个。
答案 0 :(得分:-1)
您只能在主要上下文中创建一个包含多个子菜单但不包含两个父项的父项。虽然孩子也可以是父母。
试试此示例:https://developer.chrome.com/extensions/samples#search:context