MCPcopy
hub / github.com/ampproject/amphtml / installPullToRefreshBlocker

Function installPullToRefreshBlocker

src/pull-to-refresh.js:9–22  ·  view source on GitHub ↗
(win)

Source from the content-addressed store, hash-verified

7 * @param {!Window} win
8 */
9export function installPullToRefreshBlocker(win) {
10 // Only do when requested and don't even try it on Safari!
11 // This mode is only executed in the single-doc mode.
12 const {documentElement} = win.document;
13 if (
14 Services.viewerForDoc(documentElement).getParam('p2r') == '0' &&
15 Services.platformFor(win).isChrome()
16 ) {
17 new PullToRefreshBlocker(
18 win.document,
19 Services.viewportForDoc(documentElement)
20 );
21 }
22}
23
24/**
25 * Visible for testing only.

Callers 1

bootstrapFunction · 0.90

Calls 2

isChromeMethod · 0.80
getParamMethod · 0.45

Tested by

no test coverage detected