parent
10529870bb
commit
d6b6d4c09f
1 changed files with 5 additions and 6 deletions
|
|
@ -1209,13 +1209,12 @@ export class KBService implements IGBKBService {
|
||||||
await min.core['setConfig'](min, 'Color2', colors[1].hex());
|
await min.core['setConfig'](min, 'Color2', colors[1].hex());
|
||||||
}
|
}
|
||||||
// Disables images in crawling.
|
// Disables images in crawling.
|
||||||
|
await page.route('**/*', route => {
|
||||||
await page.setRequestInterception(true);
|
const type = route.request().resourceType();
|
||||||
page.on('request', req => {
|
if (type === 'image' || type === 'stylesheet') {
|
||||||
if (req.resourceType() === 'image' || req.resourceType() === 'stylesheet') {
|
route.abort();
|
||||||
req.abort();
|
|
||||||
} else {
|
} else {
|
||||||
req.continue();
|
route.continue();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue