Skip to content

Commit

Permalink
Better destructuring and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Griffith committed Jan 17, 2020
1 parent 26eea98 commit f7b5b34
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:');

Expand Down

0 comments on commit f7b5b34

Please sign in to comment.