我想将扩展名显示为弹出窗口或扩展图标附近的停靠面板。目前我将其显示为弹出窗口:
清单:
"background": {
"persistent": true,
"scripts": ["background.js"]
},
background.js:
chrome.runtime.onMessage.addListener(function (msg, sender) {
chrome.pageAction.show(sender.tab.id);
});
chrome.pageAction.onClicked.addListener(function(tab){
chrome.windows.create({
url: chrome.runtime.getURL("popup.html"),
type: "popup"
}, function(win){
vid = win.id;
});
});
相反,我如何才能显示为停靠面板if(){}?