Hacker News new | ask | show | jobs
by carl8 1992 days ago
I'm going through converting a Chrome extension to Safari 14, and the process isn't nearly as seamless as shown, although it's nice to have the converter tool.

Chrome extensions only support the 'chrome' namespace, while Firefox supports 'chrome' and 'browser', but Safari 14 only supports 'browser'. So our extension had been using the 'chrome' namespace which worked under Firefox, but now needed to be converted. 'chrome' uses callback functions, while 'browser' uses Promises. So you have to port your Chrome extension to use 'browser' and use the following polyfill: https://github.com/mozilla/webextension-polyfill

Here's some incompatibilities between Chrome and Firefox to consider: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Web...

Also had some html/css glitches to fix in Safari. Some other issues others have mentioned such as notifications and webRequest APIs.

1 comments

> Chrome extensions only support the 'chrome' namespace, while Firefox supports 'chrome' and 'browser', but Safari 14 only supports 'browser'.

According to the documentation, "Safari web extensions support both the chrome.* and browser.* namespaces." https://developer.apple.com/documentation/safariservices/saf...

Ah, well that may have well been a recent update. I'll have to try it again under chrome.* It didn't used to work at all unless I replaced chrome.* with browser.