@ombori/ga-gridapp-iframe
Advanced tools
Comparing version 2.65.11 to 2.72.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [2.72.0](https://github.com/ombori/gridapp/compare/v2.71.0...v2.72.0) (2021-07-18) | ||
### Features | ||
* pass iframe messages for nested installations ([8809714](https://github.com/ombori/gridapp/commit/8809714bb4cd2d08fbeb476b398b80c16ff3c385)) | ||
## [2.65.11](https://github.com/ombori/gridapp/compare/v2.65.10...v2.65.11) (2021-06-09) | ||
@@ -8,0 +19,0 @@ |
@@ -59,2 +59,18 @@ var __assign = (this && this.__assign) || function () { | ||
}, [iframeRefContainer, root, id, settings]); | ||
// pass iframe message for nested installations | ||
useEffect(function () { | ||
window.addEventListener('message', function (event) { | ||
var _a; | ||
// Do we trust the sender of this message? (might be | ||
// different from what we originally opened, for example). | ||
console.log('message received:', event); | ||
var origin = event.origin, data = event.data; | ||
if (origin !== 'https://app.omborigrid.com') { | ||
return; | ||
} | ||
if (iframeRefContainer.current) { | ||
(_a = iframeRefContainer.current.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(data, 'https://app.omborigrid.com/'); | ||
} | ||
}, false); | ||
}, []); | ||
return (React.createElement("iframe", __assign({ style: iframeStyles, title: "Gridapp", scrolling: "no", width: "100%", height: "100%", ref: iframeRefContainer, src: src }, restProps))); | ||
@@ -61,0 +77,0 @@ }; |
{ | ||
"name": "@ombori/ga-gridapp-iframe", | ||
"version": "2.65.11", | ||
"version": "2.72.0", | ||
"main": "dist/index.js", | ||
@@ -16,3 +16,3 @@ "license": "UNLICENSED", | ||
}, | ||
"gitHead": "71789e12add70360d961d58bb6c08c7bf0653264" | ||
"gitHead": "906786cb317e609247c9edd22e232ed8445971d6" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
12866
300