1 Star 0 Fork 0

橙子/chrome-search

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
background.js 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
张坤 提交于 2022-10-02 19:40 . update
// chrome.runtime.onInstalled.addListener(() => {
chrome.contextMenus.create({
title: '搜索',
id: 'search',
type: 'normal',
contexts: ['all'],
});
chrome.contextMenus.create({
title: '百度',
parentId: 'search',
id: 'baidu',
type: 'normal',
contexts: ['all'],
});
chrome.contextMenus.create({
title: '必应',
parentId: 'search',
id: 'bing',
type: 'normal',
contexts: ['all'],
});
chrome.contextMenus.create({
title: '360',
parentId: 'search',
id: '360',
type: 'normal',
contexts: ['all'],
});
chrome.contextMenus.create({
title: '搜狗',
parentId: 'search',
id: 'sogou',
type: 'normal',
contexts: ['all'],
});
chrome.contextMenus.create({
title: '维基百科',
parentId: 'search',
id: 'wiki',
type: 'normal',
contexts: ['all'],
});
chrome.contextMenus.create({
title: '谷歌',
parentId: 'search',
id: 'google',
type: 'normal',
contexts: ['all'],
});
// });
// 点击弹出菜单
chrome.contextMenus.onClicked.addListener(function(item, tab) {
console.log(1);
chrome.tabs.sendMessage(tab.id, item, function() {
console.log(arguments, chrome.runtime.lastError);
});
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xuchengzhi/chrome-search.git
git@gitee.com:xuchengzhi/chrome-search.git
xuchengzhi
chrome-search
chrome-search
main

搜索帮助