How to skip the code execution from PhantomJS or grover
问题 The problem is next: I have JavaScript code in my application and I want to skip/hide some peace of code from PhantomJS and grover checking/execution. So, how can I skip/hide the code execution from PhantomJS or grover? Note: the problem has occurred when I was writing the JavaScript unit-tests. But I think it would be helpful in other cases. 回答1: You just need to wrap the code with simple verification: if (!window['phantom'] && !window['_phantom']) { // your code here... } In this case the