trakt-tools / universal-trakt-scrobbler

MIT License
559 stars 54 forks source link

Make compatible with Manifest v3 #256

Closed rafaelgomesxyz closed 1 year ago

rafaelgomesxyz commented 1 year ago

Fixes #156

NOTE: This should be carefully tested, as some things might still be broken. I'll continue to test on my end throughout this week.

This follows Chrome's migration guide and:

There might be other changes that need to be made.

These changes should be fully backwards compatible with manifest v2. Webpack is configured to build v2 for Firefox and v3 for Chrome, as v3 isn't accepted in the Firefox store yet, as far as I could tell.

rafaelgomesxyz commented 1 year ago

@MrMamen It's a WIP, but if you already want to take a look.

rafaelgomesxyz commented 1 year ago

@MrMamen Can we try to land this? I didn't test too much (also mostly just Netflix), but we can always refine it later. I'd like to release it on Chrome soon.

MrMamen commented 1 year ago

Yes. I'll test it a bit.

MrMamen commented 1 year ago

NRK doesn't work with scrobbeling. This is due to the injection script not working. (Only tested on Chrome).

rafaelgomesxyz commented 1 year ago

Got it, thanks, I'll see if I can fix it.

rafaelgomesxyz commented 1 year ago

@MrMamen Script injection for functions should be fixed.

MrMamen commented 1 year ago

@MrMamen Script injection for functions should be fixed.

It seems to me that the scrobbling part needed to be disabled and re-enabled after switching to this branch. (for NRK at least.) If there is no way to prevent this, perhaps the migrate script should simply disable the scrobbling for injection-script sites?

rafaelgomesxyz commented 1 year ago

@MrMamen Script injection for functions should be fixed.

It seems to me that the scrobbling part needed to be disabled and re-enabled after switching to this branch. (for NRK at least.) If there is no way to prevent this, perhaps the migrate script should simply disable the scrobbling for injection-script sites?

But that's for Chrome, right? I don't think it will be possible to migrate from v2 to v3 on Chrome, because they have different IDs, so they should be two separate extensions when installed. That wasn't the case for you because you probably don't have the ID configured in your .env. Unfortunately, I think Chrome users will have to reconfigure their options.

rafaelgomesxyz commented 1 year ago

I'll see if I can add an import/export functionality to allow users to move their data.

MrMamen commented 1 year ago

I'll see if I can add an import/export functionality to allow users to move their data.

Om not sure how important this is. More important to get this to shipped. We should be more careful with these things after it hits the Web Stores.

rafaelgomesxyz commented 1 year ago

Ok, I've actually already uploaded it to the Chrome store because I wanted to test something: https://chrome.google.com/webstore/detail/universal-trakt-scrobbler/mbhadeogepkjdjeikcckdkjdjhhkhlid

But before we add it to the README I want to land another PR that I'll open later today that allows users to do a full initial sync.

MrMamen commented 1 year ago

I experience that at least netflix history keeps loading/spinning forever, with no obvious error..