1

Is it possible to disable js after run the driver ? I don't want to add

    options.AddArguments("--disable-javascript");

because I just want to disable it on one page

  • I did a quick investigation and didn't find a clean answer. Do you have access to edit the page you're trying to disable javascript on? Since Javascript has global scope, you might be able to set a flag via selenium, as in click a 'disable Javascript' button and have your functions check for that flag before they perform their actions. This way is a bit hokey and I would definitely make sure to have your build pipeline strip this out of your code before it gets near production, but it is one option. – Dan Csharpster Dec 30 '20 at 20:04

0 Answers0