Skip to content

AMP Links

Kain edited this page Mar 1, 2024 · 2 revisions

About AMP

AMP threatens the Open Web. For example, Google mobile Search’s Top Stories carousel has a premium position above of all other results, which is only accessible for cached AMP pages. This has the effect of further reinforcing Google’s dominance of the Web. Other concerns include: the questionable performance boost, the way cached AMP pages keep users in Google's ecosystem, the obscurity of publisher's domains on cached AMP pages, the loss of sovereignty of websites, the lack of functionality and diversity on some AMP pages and of course, privacy concerns.

Reddit user Killed_Mufasa (creator of amputatorbot.com) wrote a more detailed explanation, you can read this on Reddit.

Example

Two quick examples of the resulting de-amped URL.

Input: https://www-express-co-uk.cdn.ampproject.org/v/s/www.express.co.uk/entertainment/gaming/1605383/Best-co-op-games-Tiny-Tina-Wonderlands-It-Takes-Two-Overcooked-Streets-of-Rage-4/amp?amp_gsa=1&amp_js_v=a9&usqp=mq331AQIKAGwASCAAgM%3D#amp_tf=From%20%251%24s&aoh=16518029234618&csi=0&referrer=https%3A%2F%2Fwww.google.com&ampshare=https%3A%2F%2Fwww.express.co.uk%2Fentertainment%2Fgaming%2F1605383%2FBest-co-op-games-Tiny-Tina-Wonderlands-It-Takes-Two-Overcooked-Streets-of-Rage-4
Clean: https://www.express.co.uk/entertainment/gaming/1605383/Best-co-op-games-Tiny-Tina-Wonderlands-It-Takes-Two-Overcooked-Streets-of-Rage-4/amp
New Host: true
70.74% smaller (336 characters)

Input: https://www.google.com/amp/s/www.bostonglobe.com/lifestyle/style/2014/01/11/the-ice-rink-becomes-runway-for-female-figure-skaters/ZfSFpCEEKGGPrwzAcvnGRN/story.html
Clean: https://www.bostonglobe.com/lifestyle/style/2014/01/11/the-ice-rink-becomes-runway-for-female-figure-skaters/ZfSFpCEEKGGPrwzAcvnGRN/story.html
New Host: true
12.88% smaller (21 characters)

How to disable

This project has very minimal AMP support and is largely untested as I don't browse many websites. For the most part I'd rely on users to submit issues when they find these links, then I'd test them best I can before adding support. When disabled, the URL parameters will be cleaned as usual but the package will not attempt to de-amp the URL. If you don't mind AMP links and want to keep them as is, use the following setting:

TidyURL.config.set('allowAMP', true);
// or
TidyURL.config.allowAMP = true;

Final note

Because of how AMP works sometimes the resulting URL will be entirely different from the AMP link. amputatorbot.com appears to have built a database based on the resulting AMP link, probably using a crawler to visit each link and store the resulting URL. This is not something I can build into tidy-url without bloating the project too much, and calling their API for every AMP link would cause significant delays in the userscript.

This may change in the future.

Clone this wiki locally