已启用page_action图标,但在Edge上没有弹出窗口



我没能让一个琐碎的page_action在Edge中工作。它变为活动的,但不会像浏览器操作那样弹出弹出html。

mainifest.json

{
"manifest_version" : 2,
"name": "Page action",
"version": "0.1",
"description": "Hello World",
"page_action": {
"default_icon": "icon16.png", 
"default_title": "PageActioner",
"default_popup": "popup.html"
},
"background": {
"scripts": ["background.js"]
}             
}

background.js

console.log("This goes nowhere would be good to get working.");
chrome.tabs.query({currentWindow: true, active: false}, function(tabs) {
chrome.pageAction.show(tabs[0].id);  // Colored in first tab, hacky but works
});

// This can work, but should not be needed and pops up in the wrong place
// let winUrl = chrome.extension.getURL("popup.html");
// chrome.pageAction.onClicked.addListener(function (tab) { 
//   let wd=window.open(winUrl,  "_blank",  width=500,height=200,left=1,top=1,location=1");
// });

是否存在权限问题?有没有一种方法可以在开发时说出所有权限?(我正在从一个文件侧面加载这个。(

此外,console.log((似乎消失了,但警报似乎起作用了。

感谢您的帮助。

由于一些毫无意义的原因,这开始神奇地起作用。我将把它作为一个琐碎的页面操作示例留在这里,它可能会对某人有所帮助。

最新更新