(win)
| 161 | * @param {!Window} win |
| 162 | */ |
| 163 | export function warmupStatic(win) { |
| 164 | // Preconnect using an image, because that works on all browsers. |
| 165 | // The image has a 1 minute cache time to avoid duplicate |
| 166 | // preconnects. |
| 167 | new win.Image().src = `${urls.cdn}/preconnect.gif`; |
| 168 | // Preload the primary AMP JS that is render blocking. |
| 169 | const linkRel = /*OK*/ document.createElement('link'); |
| 170 | linkRel.rel = 'preload'; |
| 171 | linkRel.setAttribute('as', 'script'); |
| 172 | linkRel.href = `${urls.cdn}/v0.js`; |
| 173 | getHeadOrFallback(win.document).appendChild(linkRel); |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * For events (such as touch events) that point to an eligible URL, preload |
no test coverage detected