-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[request] Manifest V3 serviceWorker example #528
Comments
Please also see #526 |
@jfunction I'm in the exact same situation as you, do you know when MV3 is going to be fully supported? |
MV3 is supported. Right now. In chrome 88. I'm not sure why this issue doesn't seem to be a priority (or at least updating the docs, since the "MV3" docs are still talking about MV2 functionality). I needed to get some work done on it and didn't want to be stuck relying on this issue being resolved so I eventually caved and started my extension with MV2. I now see why having a clunky always-on background worker is being phased out. I just wish it was a bit easier learn how to do away with the background worker and move to service workers (and probably persistent thread-safe storage of state?). |
@petele shared https://developer.chrome.com/blog/new-in-chrome-88/#mv3 Hopefully someone at Google sees this and can assist. |
We have a few MV3 examples in the repo and this point and I'm in the process of converting MV2 extensions to MV3. If there's a particular example you'd like to see prioritized, please open a new issue for it. |
cannot find a workable service-worker based background sample, I am frustrated that a simple runtime.onMessage doesn't work :( |
@ghzhou I ran into the same issue, this seems to be a bug as outlined in the comment to my post. I cannot even get a simple EditTurns out my issue was caused by vendor splitting optimization in webpack (see update 4 in my linked post), removing that from webpack made everything work properly for me! |
A year gone by and all these comments and someone can't drop an example of a service worker. Yes, we've read the one low-quality "migrating to v3" article, thanks. |
Absolutely insane. Docs say we can use ESM, yet the worker throws because of an import statement. But make sure to use a Is anyone actually working on this? What is happening here? Why are the resources for this so exceptionally poor? |
Expample with service_worker on manifest v3: |
Is there still no way to replace HTML content (before page load) using manifest v3? That's the only example I want to see. (Is Google still trying to kill off ad-blockers?) |
@mindplay-dk Thanks for the feedback. Can you please provide a bit more context. What is the specific use case that you have in mind? How would you have solved it in an MV2 extension? |
Nothing specific, just trying to learn. Any basic example of modifying the body would do. Let's say, replacing all occurrences of The important point is, the content should be modified before it loads - and not by performing a redirect. Having spent most of my day on this, I'm starting to suspect it's not at all possible?
I don't know. I can't figure it out anymore. I swear I did this, many years ago... but I might have been using manifest v1 then, I don't recall. I've read this post which makes the whole situation with v3 sound pretty bleak. But from the way they describe the situation, it sounds at least v2 was capable of this? Anything changed with v3 since this article about a year ago? |
Manifest v3 states that service workers replace background pages, but currently there's no real example of how to achieve this and the migration guide doesn't help at all.
There are some hints of how to use SW around Stack Overflow, but all of them make use of the background script (e.g. this one).
It would be great if someone show us an example of how to use service workers in Chrome extensions correctly.
The text was updated successfully, but these errors were encountered: