tshaddix / webext-redux

A set of utilities for building Redux applications in Web Extensions.
MIT License
1.22k stars 180 forks source link

Is manifest version 3 support planned? #284

Closed avalanche1 closed 2 months ago

avalanche1 commented 2 years ago

Interesting, since the notion of background script is now deprecated in favour of service workers

colbat commented 2 years ago

Looks like it can already be used with Manifest v3. At least in my case it works well so far. Please see https://github.com/tshaddix/webext-redux/issues/244#issuecomment-1201650898

And you can find an example repo I made here: https://github.com/colbat/webext-redux-event-driven

hibroseph commented 1 year ago

@colbat I ran into a specific problem I am trying to trouble shoot and I wonder if you have any direction on whether this could be a webext-redux issue or if I am using it incorrectly.

I have written code to reactivate it following your examples when I do an action on a script I have running on the webpage. This works as expected and the change is made, sent to the backend redux store, and then rerendered on the page.

The problem comes in when I go to another tab (with the service worker already reactivated from another tab) and do an action (such a change a color of something I am rendering in my react app), I see the change made to the redux store in the background code, but I do not see my app getting updated with the change to the store.

Let me know if you have any quick insight into this

Update: I am seem to fix this by hooking into the onDisconnect callback on the port and creating a simple middleware to see if we have been disconnected, and if so, reconnect

SmoothRecursion commented 1 year ago

@colbat I ran into a specific problem I am trying to trouble shoot and I wonder if you have any direction on whether this could be a webext-redux issue or if I am using it incorrectly.

I have written code to reactivate it following your examples when I do an action on a script I have running on the webpage. This works as expected and the change is made, sent to the backend redux store, and then rerendered on the page.

The problem comes in when I go to another tab (with the service worker already reactivated from another tab) and do an action (such a change a color of something I am rendering in my react app), I see the change made to the redux store in the background code, but I do not see my app getting updated with the change to the store.

Let me know if you have any quick insight into this

Update: I am seem to fix this by hooking into the onDisconnect callback on the port and creating a simple middleware to see if we have been disconnected, and if so, reconnect

Could you explain this a bit more, I am running into the same issue. Are you reconnecting from the content script side? @hibroseph

SidneyNemzer commented 3 months ago

MV3 support will be implemented by #297. Sorry for the wait!