Post

Replies

Boosts

Views

Activity

Reply to Background script import fails in version 3 Safari extension
This is finally fixed! https://webkit.org/blog/13966/webkit-features-in-safari-16-4/#safari-web-extensions And I even tested, and it even works :). I was very much not looking forward to any of these hacks (using "scripts" instead of "service_worker", and no type="module", etc) after starting to migrate my extension from Chrome and it turns out (almost) all of the bugs I was facing have been fixed in 16.4! Note to self - make sure your system is up-to-date before starting in-depth debugging...
Apr ’23
Reply to [Safari Extension Dev] Return from browser.scripting.executeScript is always null?
This is working for me with 16.4.1, at least when I run it with world: "MAIN". Here is my working (chromium/safari cross-platform) code: const stuff = await chrome.scripting.executeScript({ target: { tabId: tab.id }, func: (lang) => { const subs = window.mysubs[lang]; const language = window.mylanguage; return { subs, language, }; }, args: [myLang], world: "MAIN", }); /* safari doesn't return InjectionResults, it returns the values directly;*/ myData = stuff[0]?.result || stuff[0];
May ’23