Greasy Fork is available in English.

YT2Invidio

Point YouTube links to Invidious, Twitter to Nitter, Instagram to Bibliogram, Reddit to Teddit, Medium to Scribe

< Opinie na YT2Invidio

Ocena: Dobry - skrypt działa

§
Napisano: 15-05-2020

Change embeds to links/placeholders

Hey,

I really like the userscript, works fine in obscure browsers as well (Pale Moon, K-Meleon). However Xenforo forum software used on a private forum I visit regularly insists on embedding everything. Twitter, instagram, youtube etc each are presented inside their iframe. Visiting some news sites also embed these instead of screenshots/plain links.

I have twitter, youtube and instagram embeds blocked from loading due to obvious privacy issues as well as slowing down browsing a lot. Maybe this userscript should also remove those embeds and instead present either a simple link or a custom html placeholder can click to visit the more privacy friendly and lighter front-ends? This way also wouldn't need to hack embeds to show properly (nitter doesn't have embed feature).

IzzySoftAutor
§
Napisano: 15-05-2020

This script also rewrites embedded links (at least for YT – and those work as I've see, the URL is rewritten; I never checked if those videos really "play" as I didn't allow the 3rd party JS). The script won't remove frames however, and I have no plans of implementing that. It's a rewriter, not a remover ;) For doing that (or blocking them), rather use uMatrix/uBlock Origin.

§
Napisano: 15-05-2020

Yes, I've noticed YT embeds get translated to invidious embeds, but instagram and twitter embeds won't work. I can remove the embeds with uBlock Origin, but that of course takes the links away too. That's why asked if it is in your interest to override embeds to links/clickable placeholders.

This is of course your decision, just something I feel would be nice. Can try to find an another script/add-on for that if out of the scope of this script.

Another thing is that if I open a link from an another software, the userscript doesn't get triggered so it still loads the original link. Userscript limitation or could somehow force a check on the url being opened as well?

§
Napisano: 15-05-2020

Actually instagram embeds not working for me might be because Xenforo forum embed urls are in the form of https://s9e.github.io/iframe/2/instagram.min.html#{instagramuniqueid}

§
Napisano: 15-05-2020

Hate not being able to edit my posts. As for redirecting already loading url, might take a look here https://greasyfork.org/en/scripts/403100-url-replacer-redirector/code

IzzySoftAutor
§
Napisano: 15-05-2020

Yes, rewriting of embedded links for Instagram/Twitter would be fully within the scope of this script. If you can send me some examples (original link, to what it should be rewritten, plus an example page to test it with – the latter ideally not too tracker-ridden or otherwise overloaded), I can look into that.

As for "links opened from another software": Works as designed. Userscripts can only rewrite what is inside a page once it's loaded (i.e. when the content is available). So if you pass an URL to your browser, the userscript only kicks in once the browser has loaded the content. Nothing I can do about that.

§
Napisano: 15-05-2020

https://bbs.io-tech.fi/threads/f1-yleiskeskustelu.178235/post-6966702 Here's one example I could find. (It is a Finnish tech-forum, no trackers except social media embeds and google analytics.). https://s9e.github.io/iframe/2/instagram.min.html#CAKZfr4DZUd is the iframe url. Should translate to https://bibliogram.snopyta.org/p/CAKZfr4DZUd (using snopyta myself)

Seems the iframe url is always the same with the unique id after the # mark, so should be straightforward to add as a rule.

§
Napisano: 15-05-2020

As for twitter the iframes use the same logic https://s9e.github.io/iframe/2/twitter.min.html#1256849904263024641 where the unique id is after # mark. Should redirect to https://nitter.snopyta.org/user/status/1256849904263024641.

Here's the forum link to that post: https://bbs.io-tech.fi/threads/intel-julkaisi-kuvan-jaettimaeisestae-xe-hp-laskentapiiristae.243311/post-6918811

Funnily enough if disable scripts in uBlock Origin the twitter embed shows an error text to disable adblock but also a link which does get translated to nitter url. However not sure if stay that way forever so would prefer a cleaner embed to link transform.

§
Napisano: 15-05-2020
Edytowano: 16-05-2020

[double post]

IzzySoftAutor
§
Napisano: 15-05-2020

Even if that redirector would work before the page is loaded, I'd not do so here, sorry. That would make it impossible to e.g. open the "original site" from an Invidious page. Feel free to use the other script together with this one.

As for editing: don't you have that cog wheel at the top-right of your posts (looging like a "settings icon")? Click that, and it should give you an "edit" option.

§
Napisano: 16-05-2020

Fair enough, have to figure how to use them together.

And you are right, there is a cogwheel. I use uBO to hide media elements, and apparently that got hidden too because no alt text or placeholder.

Odpowiedz

Zaloguj się, by odpowiedzieć.