-
Notifications
You must be signed in to change notification settings - Fork 93
Firefox Support
Support for Firefox currently exceeds that for all other browsers, most notably via support for customizable Firefox profiles. I've included support for several of these advanced featues in the clj-webdriver.firefox
namespace.
(use 'clj-webdriver.core)
(require '[clj-webdriver.firefox :as ff])
(def b (new-driver {:browser :firefox
:profile (doto (ff/new-profile)
;; Enable Firebug
(ff/enable-extension "/path/to/extensions/firebug.xpi")
;; Auto-download certain file types to a specific folder
(ff/set-preferences {:browser.download.dir "C:/Users/semperos/Desktop",
:browser.download.folderList 2
:browser.helperApps.neverAsk.saveToDisk "application/pdf"
;; To Disable opening "First-run" Page in Browser for firebug pass the currentVersion of firebug
:extensions.firebug.currentVersion "1.10"
;; Add a proxy server
:network.proxy.http "localhost"
:network.proxy.http_port 8080
:network.proxy.type 1}))}))
The enable-extension
function can also accept a keyword argument like :firebug
. In this situation, clj-webdriver assumes you have a system variable called FIREFOX_EXTENSION_FIREBUG
defined that points to the absolute path of the *.xpi file for that extension. It then uses that to enable the extension, so you only have to have that path defined once at the system level.
The clj-webdriver Uncyclo by Daniel Gregoire and community is licensed under a Creative Commons Attribution 4.0 International License. Based on a work at https://github.com/semperos/clj-webdriver/wiki.