Include all link relations in documentLoaded message to viewer
Viewers would like to display the correct favicon for a given page they display. For that we'd need to send up the <link rel=icon>.
I think it makes sense to generalize this and to just send up a map of relations that map all link tags to their rel value (split by space) and href.
CC @chenshay
See b/34356674 for viewer changes at Google.
Related #7058
Ah :) @muxin: Did you already start working on this?
@cramforce: @muxin has https://github.com/ampproject/amphtml/pull/7078 already. @muxin, can you extend to support all link tags?
I'll start working on it by including the link tags map info into document-info-impl.js.
Would there be multiple link[rel=prefetch], link[rel=preload], link[rel=preconnect]? Do we really need to send these info up?
Or when the documentLoaded message is sent, those link tags haven't been added to the head?
Lets filter these. It would be OK for them to be in the data, but because transfer isn't free we can drop them. Soon, there will be more of those in the doc from the server side.
What is being added server side?
On Thu, Jan 19, 2017 at 7:36 PM Malte Ubl [email protected] wrote:
Lets filter these. It would be OK for them to be in the data, but because transfer isn't free we can drop them. Soon, there will be more of those in the doc from the server side.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ampproject/amphtml/issues/7086#issuecomment-273875653, or mute the thread https://github.com/notifications/unsubscribe-auth/AADk_J7Pw-w7TS7nWyt4WR7McrEkfx_Oks5rT7s5gaJpZM4LnD8t .
@dknecht We will add dns-prefetch/preconnect for the sub resource domains like randomcdn-com.cdn.ampproject.org.
@cramforce OK.
@ericfs About the naming for the link tag map (key is the rel and value is the href), is linkRels OK? It will be like:
documentLoaded:
{
title: 'foo',
...
linkRels: {'canonical': 'foo.html', 'icon': 'foo.gif'}
}
lgtm
@ericfs @cramforce Should all the link href be transformed to absolute path?
Doesn't reading .href do that?
On Fri, Jan 20, 2017 at 3:43 PM, Yuxi Chen [email protected] wrote:
@ericfs https://github.com/ericfs @cramforce https://github.com/cramforce Should all the link href be transformed to absolute path?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ampproject/amphtml/issues/7086#issuecomment-274209380, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFeTydFffXLLhGMEqX8g87UbFcjEy-Wks5rUUaggaJpZM4LnD8t .
updated:
The linkRels's value can be a string if there's only one href, or an array of string if there're multiple hrefs for the same rel