Reputation: 1856
I have converted my Chrome extension to Edge using the Converter Toolkit. The extension loads and alters the page correctly in Edge, however the Page Action button is not available in the toolbar. I've added the 20px image as others have pointed out, but that didn't do anything. Any ideas on how to get the button and popup to work?
{
"author": "Me",
"background": {
"page": "background.html",
"persistent": true
},
"content_scripts": [
{
"css": [
"styles.css"
],
"js": [
"jquery.js",
"content.js"
],
"matches": [
"*://www.engadget.com/*"
]
}
],
"description": "Hide unwanted articles on Engadget.com",
"icons": {
"20": "icon_20.png",
"128": "icon_128.png"
},
"manifest_version": 2,
"name": "SanGadget",
"page_action": {
"default_title": "SanGadget Settings",
"default_popup": "popup.html",
"default_icon": {
"20": "icon_20.png"
}
},
"permissions": [
"storage",
"declarativeContent"
],
"version": "0.1.0",
"-ms-preload": {
"backgroundScript": "backgroundScriptsAPIBridge.js",
"contentScript": "contentScriptsAPIBridge.js"
}
}
Upvotes: 1
Views: 326
Reputation: 10897
You're using chrome.declarativeContent.ShowPageAction
to show page action icon. Unfortunately, that's not supported in Microsoft Edge for now, you should consider other options.
For example, you could detect current page url (either via specific content scripts and use message passing to notify background page, or directly listen to browser.tabs.onUpdated
event in background page) and explicitly show or hide page action via pageAction
api, such as browser.pageAction.show
and browser.pageAction.hide
.
Upvotes: 1