-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch.js
More file actions
18 lines (14 loc) · 718 Bytes
/
patch.js
File metadata and controls
18 lines (14 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const fs = require('fs');
const filepath = __dirname + '/node_modules/@chainsafe/dappeteer/dist/setup/launch.js';
(async () => {
let update = false;
let launchFile = fs.readFileSync(filepath, 'utf-8')
if (launchFile.includes('args: [`--disable-extensions-except=${METAMASK_PATH}`')) {
update = true;
launchFile = launchFile.replace(/args: \[`--disable-extensions-except=\${METAMASK_PATH}`/g, "ignoreHTTPSErrors: true, args: \['--ignore-certificate-errors', `--disable-extensions-except=\${METAMASK_PATH}`");
console.log('patched the ignore https errors flag for dappeteer ::: launch.js');
}
if (update) {
await fs.writeFileSync(filepath, launchFile)
}
})();