Skip to content

Commit

Permalink
Extend docs for allowRules and sandboxRules (#3847)
Browse files Browse the repository at this point in the history
  • Loading branch information
walmazacn authored Aug 9, 2024
1 parent a902c03 commit 90c5c2d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions container/typings/LuigiContainer.svelte.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,17 @@ export default class LuigiContainer extends HTMLElement {
/**
* The list of rules for the content in the iframe, managed by the HTML `allow` attribute.
* You can use one or more rules by adding them to the array, for example allowRules: ["microphone", "camera"].
* @example <luigi-container viewUrl="/index.html" allow-rules='["microphone", "camera"]'></luigi-container>
* @example containerElement.allowRules = ['microphone', 'camera']
* @since 1.2.0
*/
allowRules: string[];

/**
* The list of rules for the content in the iframe, managed by the HTML `sandbox` attribute.
* You can use one or more rules by adding them to the array, for example sandboxRules: ["allow-scripts", "allow-same-origin"].
* @example <luigi-container viewUrl="/index.html" sandbox-rules='["allow-scripts", "allow-same-origin"]'></luigi-container>
* @example containerElement.sandboxRules = ['allow-modals', 'allow-popups']
* @since 1.2.0
*/
sandboxRules: string[];
Expand Down
20 changes: 20 additions & 0 deletions docs/luigi-container-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,16 @@ You can use one or more rules by adding them to the array, for example allowRule

Type: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>

#### Examples

```javascript
<luigi-container viewUrl="/index.html" allow-rules='["microphone", "camera"]'></luigi-container>
```

```javascript
containerElement.allowRules = ['microphone', 'camera']
```

**Meta**

* **since**: 1.2.0
Expand All @@ -219,6 +229,16 @@ You can use one or more rules by adding them to the array, for example sandboxRu

Type: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>

#### Examples

```javascript
<luigi-container viewUrl="/index.html" sandbox-rules='["allow-scripts", "allow-same-origin"]'></luigi-container>
```

```javascript
containerElement.sandboxRules = ['allow-modals', 'allow-popups']
```

**Meta**

* **since**: 1.2.0
Expand Down

0 comments on commit 90c5c2d

Please sign in to comment.