SponsorBlock icon indicating copy to clipboard operation
SponsorBlock copied to clipboard

[Feature request]: Better storage for Invidious instances

Open ccuser44 opened this issue 2 years ago • 5 comments
trafficstars

Currently Sponsorblock stores the list of Invidious instances via two methods.

  1. If you haven't added any Invidious instances then the list if pooled from the source code.
  2. If you have added and/or removed any instances then the list gets stored with your changes. However it does not update.

The issue here is that you can either get an updating list where you can't make changes or an old list with your changes that does not update. Both have problems and are not an ideal solution. Usually a lot of invidious instances get discontinued or are buggy and you need to add new ones even when SponsorBlock has not updated. This is horrible UX and makes using Sponsorblock very cumbersome with Invidious. I propose an alternate way to do this.

In the new proposed way only the list of changes should be stored instead of all of the URLs. Example:

{
	"Added": [
		"https://iv.someurl.org",
		"https://videos.test.net",
		"https://asdfgwetyu.com"
	],
	"Removed" : [
		"https://www.url1.com",
		"https://invidious.example.com"
	]
}

Then when Sponsor block is loaded the list of changes is applied over the list from the source code.

This would fix the horrible UX of dealing with Invidious instances as well as be more storage efficient than storing all of the URLs.

ccuser44 avatar Nov 14 '23 17:11 ccuser44

It cannot arbitrarily add instances because the extension would need to ask permission again when that happens

ajayyy avatar Nov 14 '23 17:11 ajayyy

It cannot arbitrarily add instances because the extension would need to ask permission again when that happens

Could there be a feature to run through the list of instances and check if the plugin has permission. If not then prompt permission from the user.

Like a button in the settings Check permission for instances?

ccuser44 avatar Nov 14 '23 17:11 ccuser44

I don't think a changelog list would make sense at all, wouldn't

[...default list, ...custom list]

make more sense as you can add your own changes independently of bundled instances and they can be deduped at runtime/ when permissions are added

mchangrh avatar Nov 20 '23 20:11 mchangrh

I'm not 100% sure this will work (but it seems to in Firefox with my test extension), but what if you:

  • declare an optional permission of <all_urls> (no permissions prompt on install since it's an optional permission).
  • When the user adds a new instance, it calls browser.permissions.request({"origins": ["instance the user inputted"]})

Demo extension

Still would take some work to implement, and I'm sure there are better solutions. Thanks

iam-py-test avatar Nov 20 '23 21:11 iam-py-test

I don't think a changelog list would make sense at all, wouldn't

[...default list, ...custom list]

make more sense as you can add your own changes independently of bundled instances and they can be deduped at runtime/ when permissions are added

In theory yes, but in practice no. The list of workable Instances changes quite a lot (if you use an autotic redirector). A lot of the old instances get abandoned and lots of new ones are added. You would have to add a lot of URLs when every list update (which is semi often) you have to add 40 new invidious instances manually

ccuser44 avatar Nov 21 '23 08:11 ccuser44