From 503f55fe605ac021b31c81e0c67eaec40391088a Mon Sep 17 00:00:00 2001 From: Uunnamed Date: Fri, 24 Jul 2020 21:36:26 +0300 Subject: [PATCH 1/2] fix headless? && save capabilities --- src/etaoin/api.clj | 4 ++-- src/etaoin/driver.clj | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/etaoin/api.clj b/src/etaoin/api.clj index bdc0fcaf..ae5945d5 100644 --- a/src/etaoin/api.clj +++ b/src/etaoin/api.clj @@ -2958,7 +2958,7 @@ (throw e)))) (swap! driver dissoc - :session :capabilities) + :session) driver) (defn stop-driver @@ -2966,7 +2966,7 @@ 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 diff --git a/src/etaoin/driver.clj b/src/etaoin/driver.clj index 2ec0fe3f..553fd33f 100644 --- a/src/etaoin/driver.clj +++ b/src/etaoin/driver.clj @@ -245,7 +245,9 @@ (defmethod is-headless? :default [driver] - (:headless driver)) + (if-let [args (get-in driver [:capabilities (options-name driver) :args])] + (boolean (some #(= % "--headless") args)) + (:headless driver))) (defmethod is-headless? :phantom From 48586cdfd1c024f9aeb28dff12c284eb4d50b148 Mon Sep 17 00:00:00 2001 From: Uunnamed Date: Mon, 27 Jul 2020 11:09:02 +0300 Subject: [PATCH 2/2] update --- src/etaoin/driver.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/etaoin/driver.clj b/src/etaoin/driver.clj index 553fd33f..03feaa40 100644 --- a/src/etaoin/driver.clj +++ b/src/etaoin/driver.clj @@ -246,7 +246,7 @@ :default [driver] (if-let [args (get-in driver [:capabilities (options-name driver) :args])] - (boolean (some #(= % "--headless") args)) + (contains? (set args) "--headless") (:headless driver))) (defmethod is-headless?