Version 1
[yaffs-website] / vendor / jcalderonzumba / gastonjs / src / Browser / BrowserConfigurationTrait.php
diff --git a/vendor/jcalderonzumba/gastonjs/src/Browser/BrowserConfigurationTrait.php b/vendor/jcalderonzumba/gastonjs/src/Browser/BrowserConfigurationTrait.php
new file mode 100644 (file)
index 0000000..0db7f07
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+
+namespace Zumba\GastonJS\Browser;
+
+
+/**
+ * Trait BrowserConfigurationTrait
+ * @package Zumba\GastonJS\Browser
+ */
+trait BrowserConfigurationTrait {
+  /**
+   * Set whether to fail or not on javascript errors found on the page
+   * @param bool $enabled
+   * @return bool
+   */
+  public function jsErrors($enabled = true) {
+    return $this->command('set_js_errors', $enabled);
+  }
+
+  /**
+   * Set a blacklist of urls that we are not supposed to load
+   * @param array $blackList
+   * @return bool
+   */
+  public function urlBlacklist($blackList) {
+    return $this->command('set_url_blacklist', $blackList);
+  }
+
+  /**
+   * Set the debug mode on the browser
+   * @param bool $enable
+   * @return bool
+   */
+  public function debug($enable = false) {
+    $this->debug = $enable;
+    return $this->command('set_debug', $this->debug);
+  }
+
+}