You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3. Add your Browser Rendering binding to your new `wrangler.toml` configuration:
27
27
28
-
```yaml
28
+
```toml
29
29
browser = { binding = "BROWSER" }
30
30
```
31
31
@@ -66,15 +66,12 @@ export default {
66
66
Rather than using Browser Rendering to navigate to a user-provided URL, manually generate a webpage, then provide that webpage to the Browser Rendering instance. This allows you to render any design you want.
67
67
68
68
:::note
69
-
It's worth noting that you can generate your HTML or CSS using any method
70
-
you'd like. For now we're using string interpolation, but this method is
71
-
fully-compatible with web frameworks capable of rendering HTML on Workers such
72
-
as React, Remix, and Vue.
69
+
You can generate your HTML or CSS using any method you like. This example uses string interpolation, but the method is also fully compatible with web frameworks capable of rendering HTML on Workers such as React, Remix, and Vue.
73
70
:::
74
71
75
72
For this example, we're going to take in user-provided content (via a '?name=' parameter), and have that name output in the final PDF document.
76
73
77
-
To start, let's fill out your 'generateDocument' function with the following:
74
+
To start, fill out your `generateDocument` function with the following:
This example HTML document should render a beige background imitating a certificate showing that the user-provided name has successfully rendered a PDF using Cloudflare Workers.
129
126
130
127
:::note
131
-
It's usually best to avoid directly interpolating user-provided content into
132
-
an image or PDF renderer in production applications. To render contents like
133
-
an invoice, it wold be best to validate the data input, and fetch data
134
-
yourself using tools like [D1](/d1/) or
135
-
[Workers KV](/kv/).
128
+
It is usually best to avoid directly interpolating user-provided content into an image or PDF renderer in production applications. To render contents like an invoice, it would be best to validate the data input and fetch the data yourself using tools like [D1](/d1/) or [Workers KV](/kv/).
Copy file name to clipboardExpand all lines: src/content/docs/browser-rendering/platform/puppeteer.mdx
+35-32Lines changed: 35 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ The Workers team forked a version of Puppeteer and patched it to connect to the
15
15
16
16
Our version is open sourced and can be found in [Cloudflare's fork of Puppeteer](https://github.com/cloudflare/puppeteer). The npm can be installed from [npmjs](https://www.npmjs.com/) as [@cloudflare/puppeteer](https://www.npmjs.com/package/@cloudflare/puppeteer):
17
17
18
-
```javascript
18
+
```bash
19
19
npm install @cloudflare/puppeteer --save-dev
20
20
```
21
21
@@ -83,18 +83,18 @@ In order to facilitate browser session management, we've added new methods to `p
83
83
84
84
`puppeteer.sessions()` lists the current running sessions. It will return an output similar to this:
Cloudflare Firewall Rules allows you to create rules that inspect incoming traffic and block, challenge, log, or allow specific requests.
17
16
18
17
<Renderfile="deprecation-notice" />
19
18
20
19
## Main features
21
20
22
-
***Rule-based protection**: Use pre-defined rulesets provided by Cloudflare, or define your own firewall rules. Create rules in the Cloudflare dashboard or via API.
23
-
***Complex custom rules**: Each rule's expression can reference multiple fields from all the available HTTP request parameters and fields, allowing you to create complex rules.
21
+
-**Rule-based protection**: Use pre-defined rulesets provided by Cloudflare, or define your own firewall rules. Create rules in the Cloudflare dashboard or via API.
22
+
-**Complex custom rules**: Each rule's expression can reference multiple fields from all the available HTTP request parameters and fields, allowing you to create complex rules.
24
23
25
24
## Availability
26
25
@@ -30,15 +29,15 @@ This table outlines the Firewall Rules features and entitlements available with
30
29
31
30
## Next steps
32
31
33
-
* Unless you are already an advanced user, refer to [Expressions](/ruleset-engine/rules-language/expressions/) and [Actions](/firewall/cf-firewall-rules/actions/) to learn more about the basic elements of firewall rules.
32
+
- Unless you are already an advanced user, refer to [Expressions](/ruleset-engine/rules-language/expressions/) and [Actions](/firewall/cf-firewall-rules/actions/) to learn more about the basic elements of firewall rules.
34
33
35
-
* To start building your own firewall rules, refer to one of the following pages:
34
+
- To start building your own firewall rules, refer to one of the following pages:
36
35
37
-
*[Manage firewall rules in the dashboard](/firewall/cf-dashboard/create-edit-delete-rules/)
38
-
*[Manage firewall rules via the APIs](/firewall/api/)
36
+
-[Manage firewall rules in the dashboard](/firewall/cf-dashboard/create-edit-delete-rules/)
37
+
-[Manage firewall rules via the APIs](/firewall/api/)
39
38
40
-
* You can also manage firewall rules through Terraform. For more information, refer to [Getting Started with Terraform](https://blog.cloudflare.com/getting-started-with-terraform-and-cloudflare-part-1/).
39
+
- You can also manage firewall rules through Terraform. For more information, refer to [Getting Started with Terraform](https://blog.cloudflare.com/getting-started-with-terraform-and-cloudflare-part-1/).
0 commit comments