Merge pull request #248 from getmaxun/docker-arm

fix: explicitly set easylist url
This commit is contained in:
Karishma Shukla
2024-12-11 14:19:23 +05:30
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -102,7 +102,7 @@ export default class Interpreter extends EventEmitter {
};
}
PlaywrightBlocker.fromPrebuiltAdsAndTracking(fetch).then(blocker => {
PlaywrightBlocker.fromLists(fetch, ['https://easylist.to/easylist/easylist.txt']).then(blocker => {
this.blocker = blocker;
}).catch(err => {
this.log(`Failed to initialize ad-blocker:`, Level.ERROR);

View File

@@ -232,7 +232,7 @@ export class RemoteBrowser {
// await this.currentPage.setExtraHTTPHeaders({
// 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'
// });
const blocker = await PlaywrightBlocker.fromPrebuiltAdsAndTracking(fetch);
const blocker = await PlaywrightBlocker.fromLists(fetch, ['https://easylist.to/easylist/easylist.txt']);
await blocker.enableBlockingInPage(this.currentPage);
this.client = await this.currentPage.context().newCDPSession(this.currentPage);
await blocker.disableBlockingInPage(this.currentPage);