amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Include all link relations in documentLoaded message to viewer

Open cramforce opened this issue 9 years ago • 15 comments

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.

cramforce avatar Jan 18 '17 16:01 cramforce

Related #7058

ericfs avatar Jan 18 '17 16:01 ericfs

Ah :) @muxin: Did you already start working on this?

cramforce avatar Jan 18 '17 16:01 cramforce

@cramforce: @muxin has https://github.com/ampproject/amphtml/pull/7078 already. @muxin, can you extend to support all link tags?

jridgewell avatar Jan 18 '17 18:01 jridgewell

I'll start working on it by including the link tags map info into document-info-impl.js.

muxin avatar Jan 18 '17 21:01 muxin

Would there be multiple link[rel=prefetch], link[rel=preload], link[rel=preconnect]? Do we really need to send these info up?

muxin avatar Jan 19 '17 19:01 muxin

Or when the documentLoaded message is sent, those link tags haven't been added to the head?

muxin avatar Jan 19 '17 19:01 muxin

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.

cramforce avatar Jan 19 '17 19:01 cramforce

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 avatar Jan 19 '17 19:01 dknecht

@dknecht We will add dns-prefetch/preconnect for the sub resource domains like randomcdn-com.cdn.ampproject.org.

cramforce avatar Jan 19 '17 19:01 cramforce

@cramforce OK.

muxin avatar Jan 19 '17 19:01 muxin

@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'}
}

muxin avatar Jan 19 '17 20:01 muxin

lgtm

ericfs avatar Jan 19 '17 20:01 ericfs

@ericfs @cramforce Should all the link href be transformed to absolute path?

muxin avatar Jan 20 '17 23:01 muxin

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 .

cramforce avatar Jan 21 '17 06:01 cramforce

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

muxin avatar Jan 25 '17 22:01 muxin