Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix headless? && save capabilities #249

Merged
merged 2 commits into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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))
Copy link
Collaborator

@igrishaev igrishaev Jul 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут можно чуть по-другому

(or (...)
    (:headless driver))

где первая форма

(contains? (set args) "--headless")

(if-let [args (get-in driver [:capabilities (options-name driver) :args])]
(contains? (set args) "--headless")
(:headless driver)))

(defmethod is-headless?
:phantom
Expand Down