Skip to content

Commit

Permalink
Merge pull request #36 from dsx/patch-1
Browse files Browse the repository at this point in the history
Allow passing extra arguments to Chrome binary
  • Loading branch information
tatut authored Sep 16, 2024
2 parents 56d74a6 + 89677ff commit 7c895ab
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/clj_chrome_devtools/automation/launcher.clj
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@
(log/trace "Launching Chrome headless, binary: " binary-path
", remote debugging port: " remote-debugging-port
", options: " (pr-str options))
(let [args (remove nil?
[binary-path
(when (:headless? options) "--headless")
(when (:no-sandbox? options) "--no-sandbox")
"--disable-gpu"
(str "--remote-debugging-port=" remote-debugging-port)
(when-let [url (:url-to-open options)] (str url))])]
(let [args (remove nil? (concat [binary-path
(when (:headless? options) "--headless")
(when (:no-sandbox? options) "--no-sandbox")
(when-not (:enable-gpu? options) "--disable-gpu")
(str "--remote-debugging-port=" remote-debugging-port)]
(:args options)))]
(.exec (Runtime/getRuntime)
^"[Ljava.lang.String;" (into-array String args))))

Expand Down

0 comments on commit 7c895ab

Please sign in to comment.