Skip to content

Commit 2d08863

Browse files
drerniegreptile-apps[bot]nl0
authored
docs: permissive rendering enables forms and popups (#4377)
Co-authored-by: Dr. Ernie Prabhakar <[email protected]> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Alexei Mochalov <[email protected]>
1 parent 7dbcbbe commit 2d08863

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

docs/Catalog/Preview.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,36 +54,43 @@ currently supported.
5454

5555
## Advanced: HTML rendering and Quilt Package File Server
5656

57-
The Quilt Catalog supports HTML and JavaScript in preview via iframes. By default,
58-
preview iframes do not have IAM permissions and are therefore unable to access
59-
private files in S3.
57+
The Quilt Catalog supports HTML and JavaScript in preview via iframes. By
58+
default, preview iframes do not have IAM permissions and are therefore unable to
59+
access private files in S3.
6060

6161
If you wish for your HTML to access data within the enclosing package or bucket
62-
(at the viewer's level of permissions) and/or use origin-aware Web APIs
63-
such as data storage/cookies, you must opt in to
64-
`Enable permissive HTML rendering` in [Bucket settings](Admin.md#buckets).
62+
(at the viewer's level of permissions) and/or use origin-aware Web APIs such as
63+
data storage/cookies, you must opt in to `Enable permissive HTML rendering` in
64+
[Bucket settings](Admin.md#buckets). This explicitly allows cross-origin resource
65+
sharing (CORS).
6566

6667
> You should _only enable this feature for buckets where you implicitly
6768
> trust_ the contents of the HTML files.
6869
69-
Depending on the context where the HTML file is rendered (package vs bucket view),
70-
the iframe gets the following origin:
70+
Depending on the context where the HTML file is rendered (package vs bucket
71+
view), the iframe gets the following origin:
7172

7273
* Inside a package view with permissive rendering **enabled**:
7374
the origin is the **Quilt Package File Server**.
7475

7576
* Inside a bucket view with permissive rendering **enabled**:
7677
the origin is the AWS S3 bucket endpoint.
7778

78-
* With permissive rendering **disabled** (irrespective of package or bucket view):
79-
the resource is treated as being from a special origin that always fails the
80-
same-origin policy
81-
([`allow-same-origin` iframe sandbox token](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox)
79+
* With permissive rendering **disabled** (irrespective of package or bucket
80+
view): the resource is treated as being from a special origin that always
81+
fails the same-origin policy ([`allow-same-origin` iframe sandbox
82+
token](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox)
8283
is not set).
8384

8485
> An important implication of same-origin policy is that the scripts
8586
> executed under the same origin share LocalStorage data and cookies.
8687
88+
### Allowing Forms and Popups
89+
90+
> New in Quilt Platform version 1.59.0 or higher
91+
92+
Enabling Permissive HTML now allows forms and popups to work from iframes.
93+
8794
### Package view example with permissive rendering enabled
8895

8996
1. `report.html` is a file in a package that includes a publicly available JS

0 commit comments

Comments
 (0)