Skip to content
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

Invidious, Bibliogram & Nitter instances no longer statically defined #327

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

alexoltean61
Copy link

Instead, background.js now sends requests to the Invidious / Bibliogram instance APIs and dynamically populates the instance lists based on uptime at the moment of the request. The results of the requests are cached for a minimum of 15 minutes before another request is sent, so there shouldn't be any noticeable performance bump caused by these changes.

If my code gets merged, I also plan to implement the same for Nitter and Teddit instances. However, that would require a bit more work, as there are no JSON APIs around for these sites (HTML only -- I wouldn't want to deal with parsing HTML in the extension code). I will try to figure out a solution for that only if my work so far is found to be useful.

This directly addresses #292, #264. In particular, it also fixes #325, while preventing future issues of the same kind.

Small fix also for #324.

@alexoltean61 alexoltean61 changed the title Invidious and Bibliogram instances no longer statically defined Invidious, Bibliogram & Nitter instances no longer statically defined Nov 25, 2021
@alexoltean61
Copy link
Author

Now Nitter instances are also dynamically populated based on the statuses from here. This is the JSON requested in the background by xnaas's uptime monitor frontend.

@SimonBrazell
Copy link
Owner

@Pasarel this is brilliant, need to spend a bit of time with it in the browser but from the brief look I just had at the code it looks great.

I fully understand the use of the synchronous XHR request, no judgement here 🙂

I'd love if Chrome supported async code in extensions but by the looks of it that isn't gonna happen without some massive tradeoffs in their manifest v3 spec, which btw will probably kill this extension on Chrome... but when that happens we'll finally be able to move to async code on Firefox 🙂

@makerio90
Copy link

this absolutely. most of the other pr's here are people just changing what instances there are, and i think that this is the most logical solution.

mittermichal pushed a commit to mittermichal/privacy-redirect that referenced this pull request Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invidious.tube down. Youtube redirect dangerous
3 participants