Class AdBlockerConfigurator

  • All Implemented Interfaces:
    FirefoxConfigurationParticipant

    @Deprecated
    public class AdBlockerConfigurator
    extends java.lang.Object
    implements FirefoxConfigurationParticipant
    Deprecated.
    Activates adblocker for the given firefox profile. Expects, that a adblock.xpi exists in classpath root as resource file. This can be achieved by the following POM snippet for example:
     
    <plugin>
        <groupId>org.codehaus.gmaven</groupId>
        <artifactId>groovy-maven-plugin</artifactId>
        <executions>
            <execution>
                <id>download-adblocker</id>
                <phase>generate-test-resources</phase>
                <goals>
                    <goal>execute</goal>
                </goals>
                <configuration>
                <source><![CDATA[
                    AntBuilder ant = new AntBuilder();
                    String fileName = "adblock.xpi";
                    String adBlockerPath = project.build.testOutputDirectory + File.separator + fileName;
                    File adBlockerFile = new File(adBlockerPath);
                    if ( !adBlockerFile.exists() ) {
                        String adBlockerURL = "https://addons.mozilla.org/firefox/downloads/latest/adblock-plus/addon-1865-latest.xpi";
                        println("Downloading adblocker firefox plugin from " + adBlockerURL + "...");
                        ant.mkdir(dir:project.build.testOutputDirectory);
                        ant.get(
                            src:adBlockerURL,
                            dest:adBlockerPath,
                            skipexisting:false );
                    }
                ]]></source>
                </configuration>
            </execution>
        </executions>
    </plugin>
     
    • Constructor Detail

      • AdBlockerConfigurator

        public AdBlockerConfigurator()
        Deprecated.
    • Method Detail

      • adjustFirefoxProfile

        public void adjustFirefoxProfile​(org.openqa.selenium.firefox.FirefoxProfile firefoxProfile)
        Deprecated.
        Description copied from interface: FirefoxConfigurationParticipant
        It can adjust a FirefoxProfile. It can load for example browser plugins.
        Specified by:
        adjustFirefoxProfile in interface FirefoxConfigurationParticipant
        Parameters:
        firefoxProfile - the profile to be adjusted