* @return {!Promise } * @private
()
| 366 | * @private |
| 367 | */ |
| 368 | getWorkerScript_() { |
| 369 | // Use `testLocation` for testing with iframes. @see testing/iframe.js. |
| 370 | const location = |
| 371 | getMode().test && this.win.testLocation |
| 372 | ? this.win.testLocation |
| 373 | : this.win.location; |
| 374 | const useLocal = getMode().localDev || getMode().test; |
| 375 | const workerUrl = calculateExtensionScriptUrl( |
| 376 | location, |
| 377 | this.nodom_ ? 'amp-script-worker-nodom' : 'amp-script-worker', |
| 378 | '0.1', |
| 379 | useLocal |
| 380 | ); |
| 381 | const xhr = Services.xhrFor(this.win); |
| 382 | return xhr.fetchText(workerUrl, {ampCors: false}).then((r) => r.text()); |
| 383 | } |
| 384 | |
| 385 | /** |
| 386 | * Query local or fetch remote author script. |
no test coverage detected