{"id":506,"date":"2026-05-28T00:00:00","date_gmt":"2026-05-28T00:00:00","guid":{"rendered":"https:\/\/wordpress.securinsight.ca\/index.php\/2026\/05\/28\/browser-run-use-browser-run-quick-actions-directly-from-workers-2\/"},"modified":"2026-05-28T00:00:00","modified_gmt":"2026-05-28T00:00:00","slug":"browser-run-use-browser-run-quick-actions-directly-from-workers-2","status":"publish","type":"post","link":"https:\/\/wordpress.securinsight.ca\/index.php\/2026\/05\/28\/browser-run-use-browser-run-quick-actions-directly-from-workers-2\/","title":{"rendered":"Browser Run &#8211; Use Browser Run Quick Actions directly from Workers"},"content":{"rendered":"<p>You can now call <a href=\"https:\/\/developers.cloudflare.com\/browser-run\/quick-actions\/\">Browser Run Quick Actions<\/a> directly from a <a href=\"https:\/\/developers.cloudflare.com\/workers\/\">Cloudflare Worker<\/a> using the <code>quickAction()<\/code> method on the browser binding. This simplifies how Workers interact with Browser Run by removing the need for API tokens or external HTTP requests. Your Worker communicates with Browser Run directly over Cloudflare&#8217;s network, resulting in simpler code and lower latency.<\/p>\n<p>With the <code>quickAction()<\/code> method you can:<\/p>\n<ul>\n<li><a href=\"https:\/\/developers.cloudflare.com\/browser-run\/quick-actions\/screenshot-endpoint\/\">Capture screenshots<\/a> from URLs or HTML<\/li>\n<li><a href=\"https:\/\/developers.cloudflare.com\/browser-run\/quick-actions\/pdf-endpoint\/\">Generate PDFs<\/a> with custom styling, headers, and footers<\/li>\n<li><a href=\"https:\/\/developers.cloudflare.com\/browser-run\/quick-actions\/content-endpoint\/\">Extract HTML content<\/a> from fully rendered pages<\/li>\n<li><a href=\"https:\/\/developers.cloudflare.com\/browser-run\/quick-actions\/markdown-endpoint\/\">Convert pages to Markdown<\/a><\/li>\n<li><a href=\"https:\/\/developers.cloudflare.com\/browser-run\/quick-actions\/json-endpoint\/\">Extract structured JSON<\/a> using AI<\/li>\n<li><a href=\"https:\/\/developers.cloudflare.com\/browser-run\/quick-actions\/scrape-endpoint\/\">Scrape elements<\/a> with CSS selectors<\/li>\n<li><a href=\"https:\/\/developers.cloudflare.com\/browser-run\/quick-actions\/links-endpoint\/\">Get all links<\/a> from a page<\/li>\n<li><a href=\"https:\/\/developers.cloudflare.com\/browser-run\/quick-actions\/snapshot\/\">Capture snapshots<\/a> (HTML + screenshot in one request)<\/li>\n<\/ul>\n<p>To get started, add a browser binding to your Wrangler configuration:<\/p>\n<ul>\n<li>\n<p>wrangler.jsonc<\/p>\n<div>\n<div>\n<figure>\n<pre data-language=\"jsonc\"><code class=\"language-jsonc\"><div><div><span>{<\/span><\/div><\/div><div><div><span>  <\/span><span>\"<\/span><span>compatibility_date<\/span><span>\"<\/span><span>:<\/span><span> <\/span><span>\"2026-03-24\"<\/span><span>,<\/span><\/div><\/div><div><div><span>  <\/span><span>\"<\/span><span>browser<\/span><span>\"<\/span><span>:<\/span><span> <\/span><span>{<\/span><\/div><\/div><div><div><span>    <\/span><span>\"<\/span><span>binding<\/span><span>\"<\/span><span>:<\/span><span> <\/span><span>\"BROWSER\"<\/span><\/div><\/div><div><div><span>  <\/span><span>}<\/span><\/div><\/div><div><div><span>}<\/span><\/div><\/div><\/code><\/pre>\n<div>\n<div><\/div>\n<\/div>\n<\/figure>\n<\/div><\/div>\n<\/li>\n<li>\n<p>wrangler.toml<\/p>\n<div>\n<div>\n<figure>\n<pre data-language=\"toml\"><code class=\"language-toml\"><div><div><span>compatibility_date<\/span><span> <\/span><span>=<\/span><span> <\/span><span>\"2026-03-24\"<\/span><\/div><\/div><div><div>\n<\/div><\/div><div><div><span>[<\/span><span>browser<\/span><span>]<\/span><\/div><\/div><div><div><span>binding<\/span><span> <\/span><span>=<\/span><span> <\/span><span>\"BROWSER\"<\/span><\/div><\/div><\/code><\/pre>\n<div>\n<div><\/div>\n<\/div>\n<\/figure>\n<\/div><\/div>\n<\/li>\n<\/ul>\n<p>Then call any Quick Action directly from your Worker. For example, to capture a screenshot:<\/p>\n<ul>\n<li>\n<p>JavaScript<\/p>\n<div>\n<div>\n<figure>\n<pre data-language=\"js\"><code class=\"language-js\"><div><div><span>const<\/span><span> <\/span><span>screenshot<\/span><span> <\/span><span>=<\/span><span> <\/span><span>await<\/span><span> <\/span><span>env<\/span><span>.<\/span><span>BROWSER<\/span><span>.<\/span><span>quickAction<\/span><span>(<\/span><span>\"screenshot\"<\/span><span>,<\/span><span> <\/span><span>{<\/span><\/div><\/div><div><div><span><span>  <\/span><\/span><span>url<\/span><span>:<\/span><span> <\/span><span>\"https:\/\/www.cloudflare.com\/\"<\/span><span>,<\/span><\/div><\/div><div><div><span>}<\/span><span>)<\/span><span>;<\/span><\/div><\/div><\/code><\/pre>\n<div>\n<div><\/div>\n<\/div>\n<\/figure>\n<\/div><\/div>\n<\/li>\n<li>\n<p>TypeScript<\/p>\n<div>\n<div>\n<figure>\n<pre data-language=\"ts\"><code class=\"language-ts\"><div><div><span>const<\/span><span> <\/span><span>screenshot<\/span><span> <\/span><span>=<\/span><span> <\/span><span>await<\/span><span> <\/span><span>env<\/span><span>.<\/span><span>BROWSER<\/span><span>.<\/span><span>quickAction<\/span><span>(<\/span><span>\"screenshot\"<\/span><span>,<\/span><span> <\/span><span>{<\/span><\/div><\/div><div><div><span><span>  <\/span><\/span><span>url<\/span><span>:<\/span><span> <\/span><span>\"https:\/\/www.cloudflare.com\/\"<\/span><span>,<\/span><\/div><\/div><div><div><span>}<\/span><span>)<\/span><span>;<\/span><\/div><\/div><\/code><\/pre>\n<div>\n<div><\/div>\n<\/div>\n<\/figure>\n<\/div><\/div>\n<\/li>\n<\/ul>\n<p>The <code>quickAction()<\/code> method requires a compatibility date of <code>2026-03-24<\/code> or later.<\/p>\n<p>For setup instructions and the full list of available actions, refer to <a href=\"https:\/\/developers.cloudflare.com\/browser-run\/quick-actions\/\">Browser Run Quick Actions<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>You can now call Browser Run Quick Actions directly from a Cloudflare Worker using the quickAction() method on the browser binding. This simplifies how Workers interact with Browser Run by removing the need for API tokens or external HTTP requests. Your Worker communicates with Browser Run directly over Cloudflare&#8217;s network, resulting in simpler code and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-506","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts\/506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/comments?post=506"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts\/506\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/media?parent=506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/categories?post=506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/tags?post=506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}