All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.qeagle.devtools.utils.BlockURLs Maven / Gradle / Ivy

Go to download

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