Skip to content

Commit

Permalink
Merge 4524583 into 58b992a
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Oct 19, 2021
2 parents 58b992a + 4524583 commit ae400e6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/goto/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ module.exports = ({
if (adblock) {
prePromises.push(
run({
fn: engine.enableBlockingInPage(page),
fn: Promise.resolve(engine.setRequestInterceptionPriority(1)).then(
engine.enableBlockingInPage(page)
),
timeout: actionTimeout,
debug: 'adblock'
})
Expand Down Expand Up @@ -275,9 +277,11 @@ module.exports = ({
await page.setRequestInterception(true)
page.on('request', req => {
const resourceType = req.resourceType()
if (!abortTypes.includes(resourceType)) return req.continue()
if (!abortTypes.includes(resourceType)) {
return req.continue(req.continueRequestOverrides(), 2)
}
debug('abort', { url: req.url(), resourceType })
return req.abort('blockedbyclient')
return req.abort('blockedbyclient', 2)
})
}

Expand Down

0 comments on commit ae400e6

Please sign in to comment.