lib/Remote/DesiredCapabilities.php
public function setJavascriptEnabled($enabled)
    {
        $browser = $this->getBrowserName();
        if ($browser && $browser !== WebDriverBrowserType::HTMLUNIT) {
            throw new Exception(
                'isJavascriptEnabled() is a htmlunit-only option. ' .
                'See https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities#read-write-capabilities.'
            );
        }

        $this->set(WebDriverCapabilityType::JAVASCRIPT_ENABLED, $enabled);

        return $this;
    }
public function setJavascriptEnabled($enabled)
    {
        $browser = $this->getBrowserName();
        if ($browser && $browser !== WebDriverBrowserType::HTMLUNIT) {
            throw new Exception(
                'isJavascriptEnabled() is a htmlunit-only option. ' .
                'See https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities#read-write-capabilities.'
            );
        }

        $this->set(WebDriverCapabilityType::JAVASCRIPT_ENABLED, $enabled);

        return $this;
    }
public function setJavascriptEnabled ( $ enabled ) { $ browser = $ this -> getBrowserName ( ) ; if ( $ browser && $ browser !== WebDriverBrowserType :: HTMLUNIT ) { throw new Exception ( 'isJavascriptEnabled() is a htmlunit-only option. ' . 'See https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities#read-write-capabilities.' ) ; } $ this -> set ( WebDriverCapabilityType :: JAVASCRIPT_ENABLED , $ enabled ) ; return $ this ; }
This is a htmlUnit-only option.

@param bool $enabled
@throws Exception
@return DesiredCapabilities
@see https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities#read-write-capabilities
This is a htmlUnit - only option .