* @param {!Window} win * @param {string=} status * @param {(Element|./service/ampdoc-impl.AmpDoc)=} opt_elementOrAmpDoc Whether services are provided by an * element. * @return {function(string): string}
( win, status, opt_elementOrAmpDoc )
| 150 | * @return {function(string): string} |
| 151 | */ |
| 152 | function getAttributionReportingStatusUrlVariableRewriter( |
| 153 | win, |
| 154 | status, |
| 155 | opt_elementOrAmpDoc |
| 156 | ) { |
| 157 | const substitutionFunctions = { |
| 158 | 'ATTRIBUTION_REPORTING_STATUS': () => status, |
| 159 | }; |
| 160 | const replacements = Services.urlReplacementsForDoc( |
| 161 | opt_elementOrAmpDoc || win.document |
| 162 | ); |
| 163 | const allowlist = { |
| 164 | 'ATTRIBUTION_REPORTING_STATUS': true, |
| 165 | }; |
| 166 | |
| 167 | return (url) => |
| 168 | replacements.expandUrlSync(url, substitutionFunctions, allowlist); |
| 169 | } |
no test coverage detected