My scenario is: I'm running a web automation using Selenium WebDriver to obtain data and navigate dinamicly in a website. Sometimes, a javascript file that contains a not-relevant-code take more than 1 minute to load, and it make all my code runs slow - Because when Selenium WebDriver loads an page, it waits all files be loaded.
Since i haven't access to change or modify the page source code, I didn't found a solution to that. The nearby workaround I noticed that could be useful is to apply a extension inside my ChromeDriver to do it (like AdBlocker).
Also, what i did so far with AdBlock extension:
ChromeOptions option = new ChromeOptions();
option.AddExtension("/adblock.crx");
Driver = new ChromeDriver(option);
// Here i need to block the file manually when Chrome window open
// (it is also not a problem)
Driver.Manage().Window.Maximize();
Driver.Navigate().GoToUrl(myUrl);
// Here, any url with a js file that I don't want to download
There is no mention to a method or function in Selenium WebDriver documentation or Capabilities list that is able to ignore or block a specified file for loading, like AdBlock or another similar extension. So, I would like know if is possible to do that without using external extensions.