FKAMP-4 ultimately implemented a script to redirect Google News to Bing news as a workaround for Google having made Google News extremely hostile.
It's not a great long-term solution though, so really need to look at trying to get AMP detection working on Google News
Activity
2019-06-11 17:40:21
- If you force a link to open in a new tab, Google then redirects you to the proper page
- Just like in the search results (FKAMP-2) the actual AMP content is served in an iframe directed at ampproject.org
So, there are potentially two options here.
- We could iterate over all links on a page and add
- Or, as was originally implemented as a possible fix for FKAMP-2, we could search for the
The first feels a bit messier, but the second has a couple of additional drawbacks. Firstly, it means a request still has to go out to
For some reason, even with all my scripts turned off, the
So, what we may want to look at doing is checking for
That's not perfect, but should work in principle
2019-06-11 17:44:48
Webhook User-Agent
View Commit
2019-06-11 17:50:51
- Google News page (technically rewritten with javascript)
- AMP CDN page
- (optional) Publishers own AMP page
- Proper HTML page
That's, very far from ideal, especially given the reasons noted above for why I don't really want requests to have to go out to
It's a pity it isn't as simple as search results to work around, but the only the AMP paths are written into the markup sent back from their servers.
Seems my earlier result was wrong, opening in a new tab isn't enough to force the page to redirect you to a proper result.
2019-06-11 17:55:24
- https://www-theregister-co-uk.cdn.ampproject.org/v/s/www.theregister.co.uk/AMP/2017/05/19/open_source_insider_google_amp_bad_bad_bad/
- https://www-bbc-co-uk.cdn.ampproject.org/v/s/www.bbc.co.uk/news/amp/uk-politics-48598760
We can boil that down to
So, we could skip the hop via the AMP cdn by parsing the relevant sections out of the URL. It'll break if they change their URL structure, but we'll burn that bridge when we come to it
2019-06-11 18:06:46
Webhook User-Agent
View Commit
2019-06-11 18:13:21
But, clicking through Google News I've not been able to locate any examples of that to see how Amp Project encode it into their URLs.
Google's documentation though - https://developers.google.com/amp/cache/overview#query-parameter-example - seems to specify that it'll be part of the original query string. Problem is, if we include the original (taken from the iframe) there's all sorts of gumph in there, some of which we may specifically not want to send to the origin server. Lets break the QS down:
Ah, actually, that's not so bad.
Looks like all the AMP specific stuff is pushed into the URL fragment (so is never seen by the AMP CDN, and must just be handled in JS). So, we could just split up to the fragment in order to leave the original query string in place.
2019-06-11 18:14:47
Webhook User-Agent
View Commit
2019-06-11 18:15:59
2019-06-11 18:18:55
2019-06-11 18:18:55
2019-06-11 18:19:00