
com.qeagle.devtools.utils.BlockURLs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of DevTools-Selenium Show documentation
Show all versions of DevTools-Selenium Show documentation
A declarative, efficient, and flexible Java library for integrating DevTools with Selenium WebDriver
The newest version!
package com.qeagle.devtools.utils;
import java.util.Arrays;
import java.util.List;
import com.qeagle.devtools.protocol.commands.Network;
import com.qeagle.devtools.services.ChromeDevToolsService;
public class BlockURLs {
public static void blockGivenURLs(ChromeDevToolsService devToolsService, List blockList) {
// Get the network and enable
Network network = devToolsService.getNetwork();
network.enable();
// Block some urls.
network.setBlockedURLs(blockList);
}
public static void unblockURLs(ChromeDevToolsService devToolsService) {
// Get the network and enable
Network network = devToolsService.getNetwork();
network.enable();
// Block some urls.
network.setBlockedURLs(null);
network.disable();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy