Skip to content

Commit

Permalink
fix headless? && save capabilities (#249)
Browse files Browse the repository at this point in the history
* fix headless? && save capabilities

* update
  • Loading branch information
Uunnamed authored Jul 27, 2020
1 parent eede672 commit 1b8ff07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/etaoin/api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2958,15 +2958,15 @@
(throw e))))

(swap! driver dissoc
:session :capabilities)
:session)
driver)

(defn stop-driver
"Stops the driver's process. Removes proces's data from the driver
instance. Returns a modified driver."
[driver]
(proc/kill (:process @driver))
(swap! driver dissoc :process :args :env)
(swap! driver dissoc :process :args :env :capabilities)
driver)

(defn boot-driver
Expand Down
4 changes: 3 additions & 1 deletion src/etaoin/driver.clj
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@
(defmethod is-headless?
:default
[driver]
(:headless driver))
(if-let [args (get-in driver [:capabilities (options-name driver) :args])]
(contains? (set args) "--headless")
(:headless driver)))

(defmethod is-headless?
:phantom
Expand Down

0 comments on commit 1b8ff07

Please sign in to comment.