Background script missing === creating one for me
I discovered that if I don't include
background.ts
, it will create one for me
In Chrome's case it will not be an issue, but in Firefox's case, it also makes it a Service Worker, rather than loading as MV2-style background script
It's worth noting that I specified the dev target as firefox-mv3
19 Replies
@louisgv This is pretty much the only thing preventing me from testing the extension on Firefox and pushing the update π
Is it not working at all in ff-mv3 in dev mode??
in ff-mv3, that service worker page is turned into a bg page instead :-?...
so it shoulda work doh :d
I haven't tried directly loading onto Firefox but rather through https://npm.im/web-ext
npm
web-ext
A command line tool to help build, run, and test web extensions. Latest version: 7.6.2, last published: a month ago. Start using web-ext in your project by running
npm i web-ext
. There are 26 other projects in the npm registry using web-ext.You're correct, that is, if I have a
background.ts
But if I don't, it turns out that Plasmo will create a script for me and load it as a background scriptlike bgsw? or bgp?
which version of plasmo are you using?
I'm honestly not sure how it's possible to use a Service Worker within a Chrome extension
I do know that to migrate from MV2 to MV3 you basically remove the
background.persistent
0.74.1Note that it is possible perhaps, I just don't know the method
All I know is that you need to enable some sort of a flag in Firefox
@louisgv Sorry for the ping, are you looking into it or should I push the update tomorrow?
give me a sec
very weird werid..
NGL, I love being a bug hunter π
@avi12 in the meantime I'd test with prod version <- that one doesn't have the bgsw runtime injection
oki
hmmm
That moment when Firefox is the only browser in which the extension doesn't run as expected
https://github.com/PlasmoHQ/plasmo/pull/611
PR is up to fix the bgsw in dev issue
@avi12 has reached level 28. GG!
@louisgv I noticed that if I don't have a
background.ts
, any Plasmo version above 0.75.2 doesn't allow me to run
For example, in 0.76.3
So not only will it create a background page out of thin air, I assume that Plasmo creates the proper Manifest and then for some reason it attempts to access background.service_worker
as if it's a Chromium buildcc @jeffjacobsenstaqfi Might be related
@avi12 should be fixed in latest, I also upgraded svelte to 4.x
(needed a hack which I implemented on our framework and also a PR upstream: https://github.com/sveltejs/svelte/pull/8874 )
GitHub
chore: adding default for disclose version by louisgv Β· Pull Reques...
Description
This PR allows the built-in nodejs resolver (18.x) to lookup internal/disclose-version, otherwise it yields:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './internal/discl...