Point YouTube links to Invidious, Twitter to Nitter, Instagram to Bibliogram, Reddit to Teddit, Medium to Scribe
That seems very strange. Even with the default settings, YT links should be redirected (to the default Invidious instance). Does that happen on all pages? Can you give some example URLs? Does it happen with Twitter links as well (which by default should be rewritten to nitter.net)? I'm using my script with Greasemonkey as well. Described problem only happens where content is loaded via Ajax (Javascript sub-requests) instead of being part of the original page.
As for the how: exactly as you did, so it should work. Could you check the error console (Ctrl-Shift-K) to see if there's some hint? That should show you which instances are used, and end with "Rewrite done".
Does that happen on all pages?
No YouTube or Twitter links are redirected unless they are opened from the GreasyFork website. Meaning, if they are either typed in, opened from a redirect from another website, or opened from a bookmark, they are not redirected. However, I just discovered that Instagram redirects accordingly no matter where they are opened from. The instances I'm using for Invidious and Nitter are from snopyta.org, but the Bibliogram instance is from pussthecat.org.
Direct links to the Snopyta instances: Invidious; Nitter
Can you give some example URLs?
YouTube link I have tried; Twitter link I have tried
Does it happen with Twitter links as well (which by default should be rewritten to nitter.net)?
Yes, but not Instagram links.
Described problem only happens where content is loaded via Ajax (Javascript sub-requests) instead of being part of the original page.
I don't quite know what Ajax is. I am using uMatrix to block most script requests, but what is typically required to load Invidious and YouTube has been whitelisted. Even with uMatrix disabled the problem persists.
As for the how: exactly as you did, so it should work. Could you check the error console (Ctrl-Shift-K) to see if there's some hint? That should show you which instances are used, and end with "Rewrite done".
The console does show the instances that I have assigned ending with "Rewrite done". For whatever reason, it doesn't redirect anything other than Instagram links.
The full output is:
Using '{"hosts":{"invidious":"invidious.snopyta.org","nitter":"nitter.snopyta.org","bibliogram":"bibliogram.pussthecat.org"}}' for rewrite Invidious: invidious.snopyta.org Nitter: nitter.snopyta.org Bibliogram: bibliogram.pussthecat.org Rewrite done.
if they are either typed in, opened from a redirect from another website, or opened from a bookmark, they are not redirected.
Sure not. This script parses the HTML content of the pages in the browser and rewrites the links in them. So what you manually type in, or open from your bookmarks, is not affected. Fully normal, nothing unexpected here.
The two links you posted here for me point to Invidious resp. Nitter. They do for you as well I guess?
I just discovered that Instagram redirects accordingly no matter where they are opened from.
That cannot be related to this script. It doesn't touch what you type in directly to the URL bar, or what you open via bookmarks. Besides, all rewriting takes place in the very same procedure – so it would be very strange if that behaved differently for one group (Insta) than for the others (YT, Twitter).
As for Ajax: think of dynamically updating pages, like the WebUI of Mastodon instances (where the feed constantly updates). YT2Invidio looks at the page contents one time, that is when the page is fully loaded. Ajax etc. kick in later, so their changes/additions are not handled by the script. And while it would be nice if they would, implementing that is not that trivial; I lack the time for that, plus it would add overhead as it would need to watch all open tabs constantly for changes.
Console output looks as expected and shows the script is working. If it would e.g. "crash" at some place, the last line ("Rewrite done") would be missing.
TL;DR: all seems to be working as designed – except for your expectations: YT2Invidio does not handle links opened from bookmarks or typed into the address bar manually.
Changing instance?
Hello.
I am using GreaseMonkey with this extension. I have done no configuration other than what is listed below.
I'm curious as to how to change the instance used. I selected the instance via the rightclick menu to my preferred one, but nothing gets redirected. YouTube links are still YouTube rather than Invidious etc.
How would I go about getting this script to work with my preferred instance?