Amphtml: hyperlinks with on="tap:AMP.setState.." (target=_self) are not working

Created on 5 Jul 2018  路  7Comments  路  Source: ampproject/amphtml

What's the issue?

On chrome latest release (v67) hyperlinks with a container with a on="tap:AMP.setState.." (target=_self) are not working properly and navigation is being canceled.
either adding target="_blank" or removing the on:tap handler fixes this issue.

How do we reproduce the issue?

  1. Upgrade chrome to latest Version 67.0.3396.99
  2. Open: https://moovitapp.com/index/amp/en/public_transit-line-Belmont-NYCNJ-121-726988-289161-0
  3. click on the "VIEW FULL SCHEDULE" link

Ways to "fix" it

  1. add target="_blank" to the hyperlink
  2. remove "on" attribute
  3. work on chrome canary version 69

What browsers are affected?

Chrome Version 67.0.3396.99 - Desktop

Which AMP version is affected?

latest

When Possible Bug

All 7 comments

You could use HTML anchor tag with href and target attributes. Its allowed

This is weird. The browser appears to fetch the page as a resource but doesn't navigate to it.

On Chrome Canary (Version 69.0.3484.1) this is fixed. A Chrome bug?

I think so. I added an event breakpoint for click and couldn't find any instances of event.preventDefault() or similar. Also not sure why these would show on devtools as canceled requests.

@choumx
Apparently Chrome introduced a new feature in v67:
https://www.chromium.org/Home/chromium-security/site-isolation#TOC-Diagnosing-Issues

disabling it allows the links in my site to work as expected.
again, in Chrome v69 the links work again so I hope it was a bug that they fixed.

Anyway, it might help you find the root cause of the navigation issue.

Nice find! Looks like this might be a known issue:

A few additional clicking and scrolling issues may be observed on certain sites. Fixes for many of these are already in Chrome 68.

Not sure there's much we can do besides waiting for Chrome 69.

Closing now that Chrome 69 has been out for awhile.

Was this page helpful?
0 / 5 - 0 ratings