I have converted my chrome extension to Safari and followed all the instructions: here is my manifest:
{
"manifest_version": 2,
"default_locale": "en",
"name": "__MSG_extName__",
"version": "1.0",
"homepage_url": "https://mydomain.com/",
"description": "__MSG_appDesc__",
"icons": {
"16": "images/16.png",
"32": "images/32.png",
"48": "images/48.png",
"128": "images/128.png"
},
"background": {
"scripts": [ "background.js"],
"persistent": false
},
"permissions": ["storage", "tabs", "contextMenus", "nativeMessaging", "<all_urls>"],
"browser_action" : {
"default_icon" : "images/_48.png",
"default_title" : "MyAppName v0.0.1" ,
"default_popup" : "popup.html"
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["js/content.js"],
}
]
}
I've removed everything from background.js and left the below lines for troubleshooting:
var bkg = chrome.extension.getBackgroundPage();
bkg.console.log("test1");
console.log("test2");
But I see no output. The same works for Safari macOS. I'd like to know if background.js would ever work in iOS? if yes, what do I need to do to get it working?