diff --git a/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts b/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts index 46f4867e505f2..de8449ff29132 100644 --- a/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts +++ b/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts @@ -67,11 +67,16 @@ export class HeadlessChromiumDriver { await this.page.setRequestInterception(true); - // We have to reach into the Chrome Remote Protocol to apply headers as using - // puppeteer's API will render map tiles as blanks :/ + // We have to reach into the Chrome Devtools Protocol to apply headers as using + // puppeteer's API will cause map tile requests to hang indefinitely: + // https://github.com/puppeteer/puppeteer/issues/5003 + // Docs on this client/protocol can be found here: + // https://chromedevtools.github.io/devtools-protocol/tot/Fetch client.on('Fetch.requestPaused', (interceptedRequest: InterceptedRequest) => { - const requestId = interceptedRequest.requestId; - const interceptedUrl = interceptedRequest.request.url; + const { + requestId, + request: { url: interceptedUrl }, + } = interceptedRequest; const allowed = !interceptedUrl.startsWith('file://'); const isData = interceptedUrl.startsWith('data:');