* Navigate to the given URL. Infers the target from the given anchor * tag. * @param {!Window} win * @param {!Element} a Anchor element * @param {string} url
(win, a, url)
| 140 | * @param {string} url |
| 141 | */ |
| 142 | function navigateTo(win, a, url) { |
| 143 | const target = (a.target || '_top').toLowerCase(); |
| 144 | const a2aAncestor = getA2AAncestor(win); |
| 145 | if (a2aAncestor) { |
| 146 | a2aAncestor.win./*OK*/ postMessage( |
| 147 | 'a2a;' + |
| 148 | JSON.stringify({ |
| 149 | 'url': url, |
| 150 | }), |
| 151 | a2aAncestor.origin |
| 152 | ); |
| 153 | return; |
| 154 | } |
| 155 | openWindowDialog(win, url, target); |
| 156 | } |
| 157 | |
| 158 | /** |
| 159 | * Establishes a connection to the AMP Cache and makes sure |
no test coverage detected