       nativeEvents: false,
       platform: "ANY",
       unhandledPromptBehavior: "accept",
-      chromeOptions: chrome_options(),
     }
   end
 
-  defp chrome_options, do: %{
-      args: args()
+  defp chrome_options(opts), do: %{
+      args: chrome_args(opts)
     }
 
-  defp args() do
-    default_args()
+  defp chrome_args(opts) do
+    default_chrome_args()
     |> Enum.concat(headless_args())
-  end
+    |> Enum.concat(user_agent_arg(opts[:user_agent]))
+  end
+
+  defp user_agent_arg(nil), do: []
+  defp user_agent_arg(ua), do: ["--user-agent=#{ua}"]
 
   defp headless? do
     :wallaby

  @doc false
  def user_agent do
    "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
  end

  defp default_capabilities do


  def start_session(opts) do
    {:ok, base_url} = Chromedriver.base_url()
    create_session_fn = Keyword.get(opts, :create_session_fn,
                                    &WebdriverClient.create_session/2)
    user_agent = user_agent()
                 |> Wallaby.Metadata.append(opts[:metadata])
    capabilities = capabilities(user_agent: user_agent)

    with {:ok, response} <- create_session_fn.(base_url, capabilities) do
      id = response["sessionId"]
