@iadvize-oss/boxed-tag
Advanced tools
Comparing version 1.3.1 to 1.4.0
{ | ||
"name": "@iadvize-oss/boxed-tag", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "Boxed iAdvize tag", |
@@ -38,3 +38,3 @@ # Boxed tag | ||
title="iAdvize chat notification frame" | ||
sandbox="allow-scripts allow-same-origin" | ||
sandbox="allow-scripts allow-same-origin allow-popups allow-forms" | ||
src="https://my-iframe-script-url" | ||
@@ -44,2 +44,9 @@ id="myIframeId" | ||
``` | ||
The iframe is set with the following sandbox parameters: | ||
| sandbox param | description | | ||
|-------------------|----------------------------------------------------------------| | ||
| allow-scripts | Allows the page to run iAdvize tag script. | | ||
| allow-same-origin | Allows the iAdvize tag to access the host cookies and storages | | ||
| allow-popups | Allows the iAdvize tag to open links sent by the agent | | ||
| allow-forms | Allows the iAdvize tag to submit the visitor email if needed | | ||
@@ -82,4 +89,4 @@ ## Add the host script on your site's main page | ||
```js | ||
window.addEventListener('message', ({ data: { foo } }) => { | ||
if (event.origin !== "http://myHostUrl") return; | ||
window.addEventListener('message', ({ data: { foo }, origin }) => { | ||
if (origin !== "https://myHostUrl") return; | ||
// Do something with the data sent | ||
@@ -103,6 +110,6 @@ }); | ||
```js | ||
window.addEventListener('message', (e) => { | ||
if (event.origin !== "http://myIframeUrl") return; | ||
window.addEventListener('message', ({ data: { foo }, origin }) => { | ||
if (origin !== "https://myIframeUrl") return; | ||
if (e.data.foo) { | ||
if (foo) { | ||
// Do something with the data sent | ||
@@ -109,0 +116,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30451
266