Skip to content

Commit

Permalink
feat: Add sandboxAttributes prop to solve issue from this PR https://…
Browse files Browse the repository at this point in the history
  • Loading branch information
EranGrin committed Apr 30, 2024
1 parent b8eab81 commit aeba37d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</p>
<p align="center">
<img src="https://img.shields.io/badge/license-MIT-green" alt="License MIT">
<img src="https://img.shields.io/badge/version-1.2.7-blue" alt="version 1.2.7">
<img src="https://img.shields.io/badge/version-1.2.8-blue" alt="version 1.2.8">
<img src="https://img.shields.io/badge/maintained-yes-brightgreen" alt="maintained yes">
</p>

Expand Down Expand Up @@ -158,11 +158,12 @@ Here are the new options:
| --- | --- | --- | --- | --- |
| useChatAsIframe | boolean | Whether to use the chat as an iframe. | false |
| useInAppCss | boolean | Whether to use in-app inline CSS. | false |
| useShadowDom | boolean | Whether to use shadow DOM. | true | css is always injected |
| useShadowDom | boolean | Whether to use [shadow DOM](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM). | true | css is always injected |
| requestHeaders | object | Custom headers for authentication. | {} |
| customStylesInjection | string | Custom styles to inject into the widget. | '' |
| autoInit | boolean | Whether to automatically initialize the widget. use if load in html | false |
| useLoader | boolean | Whether to use a loader as a type indication until the server responds | false |
| sandboxAttributes | string | The [sandbox attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox) for the iframe | '' | [Sandbox Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox) |

## reactiv chat open / close state
```javascript
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "git",
"url": "https://github.com/EranGrin/botman-extended-web-widget"
},
"version": "1.2.7",
"version": "1.2.8",
"description": "A BotMan frontend package for the web widget",
"type": "module",
"main": "dist/widget.js",
Expand Down
2 changes: 2 additions & 0 deletions src/typings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,6 @@ export interface IConfiguration {
autoInit?: boolean,

useLoader?: boolean,

sandboxAttributes?: string,
}
1 change: 1 addition & 0 deletions src/widget/chat-frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default class ChatFrame extends Component<any, any> {
height={isMobile ? '94%' : '100%'}
frameBorder='0'
allowTransparency
sandbox={config.sandboxAttributes}
/>
);
}
Expand Down
1 change: 1 addition & 0 deletions types/botman-extended-web-widget.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ interface Configuration {
useShadowDom?: boolean,
customStylesInjection?: string,
useLoader?: boolean,
sandboxAttributes?: string,
}

interface BotmanChatWidget {
Expand Down

0 comments on commit aeba37d

Please sign in to comment.