w3c / ServiceWorker

Service Workers
https://w3c.github.io/ServiceWorker/
Other
3.63k stars 314 forks source link

Support import() local code in extension service worker #1700

Open hanguokai opened 5 months ago

hanguokai commented 5 months ago

I know #1585 discussed import() in service worker. Here I am talking about browser extension service worker.

https://github.com/w3c/webextensions/issues/212 Some developers proposed it in WECG. Unlike Web, all code are already locally and offline available in a browser extension. So dynamically import() local code in extension service worker should just like normal javascript behavior, it should not be a problem for extensions.

According to past meeting minutes, browser vendors are basically supportive of it in extension service worker.

I think there should be no objection to supporting import() in extension service worker. Web may also support import() in service worker in the future, but there will definitely be more considerations and requirements.

tomayac commented 5 months ago

Again looping in @oliverdunk and @patrickkettner, since they may not necessarily monitor this repo.

ggaabe commented 1 month ago

I also support this; Would be a great thing to add. The current restrictions can make developing tooling in extensions that relies on service workers fairly burdensome