sindresorhus / refined-twitter

Browser extension that simplifies the Twitter interface and adds useful features
MIT License
1.31k stars 89 forks source link

Expand URLs and remove UTMs #161

Closed polomarcus closed 4 years ago

polomarcus commented 5 years ago

Fixes #21

Features

When data-expanded-url attribute is available 2 features are activated :

Expand URLs

Replace t.co URLS with data-expanded-url data screenshot from 2019-01-10 19-31-20 Tweet with a data-expanded-url

Remove UTMs

Remove UTMs from replaced URLs, leave the UTMs inside data-expanded-url though: Tweet with UTMs to test this feature

Limit

It does not remove ref=producthunt from links

It does not affect twitter card link like this one as there is no data-expanded-url and we need to have our own link unshorten API screenshot from 2019-01-10 19-45-22

sindresorhus commented 5 years ago

It does not remove ref=producthunt from links

Why?

sindresorhus commented 5 years ago

It does not affect twitter card link like this one as there is no data-expanded-url and we need to have our own link unshorten API

Can't we do the same as you do in https://github.com/polomarcus/faster-links/blob/910eeaf7d78c83d47dbf9116fde143ccf5c77480/app/scripts.babel/contentscript.js#L95 ?

polomarcus commented 5 years ago

Can't we do the same as you do in https://github.com/polomarcus/faster-links/blob/910eeaf7d78c83d47dbf9116fde143ccf5c77480/app/scripts.babel/contentscript.js#L95 ?

It uses Linkpeelr from @ibagrak , as he hasn't answered me since 2016 I guess it's OK to use it :smile: https://github.com/ibagrak/linkpeelr/issues/15

Would you be OK to use it @sindresorhus ?

About ref=producthunt, it does not seem that product hunt uses it anymore

sindresorhus commented 5 years ago

Would you be OK to use it @sindresorhus ?

Sure. You can use ky for the fetching.

About ref=producthunt, it does not seem that product hunt uses it anymore

They do. Try clicking the "Website" button here: https://www.producthunt.com/posts/makerlog-2-0

polomarcus commented 5 years ago

Update

:heavy_check_mark: No more shorten links Note: the shorten link is only displayed on hover

:warning: The full URL is displayed, and it can be long. We can trim the URL, to respect Twitter's policy on links (a maximum of 46 chars displayed) After screenshot from 2019-01-29 19-47-40 Before screenshot from 2019-01-29 19-50-05

Next step

It does not affect twitter card link like this one as there is no data-expanded-url and we need to have our own link unshorten API screenshot from 2019-01-10 19-45-22

sindresorhus commented 4 years ago

Since the last time this PR had activity, Twitter launched their redesign to everyone, so I don't think this PR is functioning anymore... Are you still interested in finishing this and retargeting the new Twitter design or should I close?