From 3cb9fac3b68802f50de14869d52de7c0fc46b654 Mon Sep 17 00:00:00 2001 From: "Sabs, like \"Sobs" Date: Sun, 17 Nov 2024 15:35:45 -0800 Subject: [PATCH] Unwrap hash in Grover.new examples (#265) Some `Grover.new` examples use (an old?) format for invocation where an explicit hash is the second argument. These fail because Grover expects keyword arguments. --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4fae14f..a462215 100644 --- a/README.md +++ b/README.md @@ -171,7 +171,7 @@ Supplementary JavaScript can be executed on the page (after render and before co by passing it to the `execute_script` option. ```javascript -Grover.new(, { execute_script: 'document.getElementsByTagName("footer")[0].innerText = "Hey"' }).to_pdf +Grover.new(, execute_script: 'document.getElementsByTagName("footer")[0].innerText = "Hey"').to_pdf ``` #### Basic authentication @@ -190,8 +190,7 @@ Chromium with the `browser_ws_endpoint` options. For example, to connect to a chrome instance started with docker using `docker run -p 3000:3000 ghcr.io/browserless/chrome:latest`: ```ruby -options = {"browser_ws_endpoint": "ws://localhost:3000/chrome"} -grover = Grover.new("https://mysite.com/path/to/thing", options) +grover = Grover.new("https://mysite.com/path/to/thing", browser_ws_endpoint: "ws://localhost:3000/chrome") File.open("grover.png", "wb") { |f| f << grover.to_png } ```