您可以使用Chrome创建contextMenusAPI并设置上下文为"contexts=browser_action" 示例chrome.contextMenus.create({ "type":"checkbox", "checked":true, "title":"Connect via Cloud", "contexts":["browser_action"], "onclick":function(info, tab) { console.log(info); } });