trait BrowserScriptTrait in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/jcalderonzumba/gastonjs/src/Browser/BrowserScriptTrait.php \Zumba\GastonJS\Browser\BrowserScriptTrait
Trait BrowserScriptTrait @package Zumba\GastonJS\Browser
Hierarchy
- trait \Zumba\GastonJS\Browser\BrowserScriptTrait
File
- vendor/
jcalderonzumba/ gastonjs/ src/ Browser/ BrowserScriptTrait.php, line 9
Namespace
Zumba\GastonJS\BrowserView source
trait BrowserScriptTrait {
/**
* Evaluates a script on the browser
* @param $script
* @return mixed
*/
public function evaluate($script) {
return $this
->command('evaluate', $script);
}
/**
* Executes a script on the browser
* @param $script
* @return mixed
*/
public function execute($script) {
return $this
->command('execute', $script);
}
/**
* Add desired extensions to phantomjs
* @param $extensions
* @return bool
*/
public function extensions($extensions) {
//TODO: add error control for when extensions do not exist physically
foreach ($extensions as $extensionName) {
$this
->command('add_extension', $extensionName);
}
return true;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BrowserScriptTrait:: |
public | function | Evaluates a script on the browser | |
BrowserScriptTrait:: |
public | function | Executes a script on the browser | |
BrowserScriptTrait:: |
public | function | Add desired extensions to phantomjs |