 
   def start_session(opts) do
     {:ok, base_url} = Chromedriver.base_url()
-    capabilities = Keyword.get(opts, :capabilities, %{})
     create_session_fn = Keyword.get(opts, :create_session_fn,
                                     &WebdriverClient.create_session/2)
-
-    capabilities = Map.merge(default_capabilities(), capabilities)
+    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"]

  @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

    |> Keyword.get(:headless, true)
  end

  def default_chrome_args() do
    [
      "--no-sandbox",
      "window-size=1280,800",
