flattr-extension icon indicating copy to clipboard operation
flattr-extension copied to clipboard

Recognize AMP Viewer URLs

Open da2x opened this issue 6 years ago • 0 comments

I looked into why so few of my mobile pages appear on Flattr. Surprise, surprise; I use Google Search so everything I visit is loaded with AMP directly on Google.com. Of course these pages aren’t being Flattr’ed.

The following is URL mappings for the two largest AMP Viewers (the page that renders AMP documents when you click on a result on a search engine result page):

https://www.google.*/amp/s/example.com/document?example
=>                https:///example.com/document?example
https://www.google.*/amp/example.com/document?example
=>               http:///example.com/document
https://www.bing.com/amp/s/example.org/articles/text
=>                https:///example.org/articles/text
https://www.bing.com/amp/example.org/articles/text
=>               http:///example.org/articles/text

The above URL mappings lead to the AMP versions of the documents. Both Bing and Google AMP Viewer also provide link[rel~="canonical"] hints to the non-AMP variants of these pages.

Some challenges:

  • Neither Bing or Google are enabled for Flattr’ing by default. People don’t want to Flattr these domains and AMP-Flattr’ing can’t be based on these domains.
  • The extension popout should display the mapped URL so people know what they’re Flattring. Should also be possible to turn domains on and off as with regular websites.

(Yes, AMP URLs are controversial and they suck. But they’re here to stay for the foreseeable future.)

da2x avatar Sep 26 '18 19:09 da2x