( win, src, referrerPolicy, attributionSrc, opt_elementOrAmpDoc )
| 23 | * @return {!Element} |
| 24 | */ |
| 25 | export function createPixel( |
| 26 | win, |
| 27 | src, |
| 28 | referrerPolicy, |
| 29 | attributionSrc, |
| 30 | opt_elementOrAmpDoc |
| 31 | ) { |
| 32 | // Caller need to verify window is not destroyed when creating pixel |
| 33 | if (referrerPolicy && referrerPolicy !== 'no-referrer') { |
| 34 | user().error(TAG, 'Unsupported referrerPolicy: %s', referrerPolicy); |
| 35 | } |
| 36 | |
| 37 | return referrerPolicy === 'no-referrer' |
| 38 | ? createNoReferrerPixel(win, src, attributionSrc, opt_elementOrAmpDoc) |
| 39 | : createImagePixel(win, src, false, attributionSrc, opt_elementOrAmpDoc); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * @param {!Window} win |
no test coverage detected