Skip to content

Commit

Permalink
more advanced method checker and implemented skipBrokenMethodsCheck #…
Browse files Browse the repository at this point in the history
  • Loading branch information
smashah committed Apr 11, 2020
1 parent 3f3ab2a commit ac5f815
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/api/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ export interface ConfigObject {
* You can find all possible arguements [here](https://peter.sh/experiments/chromium-command-line-switches/).
*/
chromiumArgs ?: string[],
/**
* If set to true, skipBrokenMethodsCheck will bypass the health check before startup. It is highly suggested to not set this to true.
* Default: false
*/
skipBrokenMethodsCheck ?: boolean,
/**
* This is the name of the session. You have to make sure that this is unique for every session.
*/
Expand Down
8 changes: 6 additions & 2 deletions src/controllers/initializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,13 @@ spinner.emit(sessionData,"sessionData");
* 3. remove brackets
* 4. go through each and test if exists.
*/
const BROKEN_METHODS = await waPage.evaluate((checkList)=>{
const BROKEN_METHODS = config?.skipBrokenMethodsCheck ? [] : await waPage.evaluate((checkList)=>{
return checkList.filter(check=> {
return eval(check)?false:true;
try{
return eval(check)?false:true;
} catch(error) {
return true;
}
})
},uniq(fs.readFileSync(path.join(__dirname, '../lib', 'wapi.js'), 'utf8').match(/(Store[.\w]*)\(/g).map((x:string)=>x.replace("(",""))));
//@ts-ignores
Expand Down

0 comments on commit ac5f815

Please sign in to comment.