dont run on iframe (#368)
This commit is contained in:
parent
fd17ab4c8b
commit
823fdcdd97
1 changed files with 14 additions and 0 deletions
|
@ -332,6 +332,20 @@ function App(props: Props) {
|
||||||
|
|
||||||
// add secure privacy script
|
// add secure privacy script
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
// check if loaded from iframe
|
||||||
|
function inIframe() {
|
||||||
|
try {
|
||||||
|
return window.self !== window.top;
|
||||||
|
} catch (e) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const loadedFromIframe = inIframe();
|
||||||
|
if (loadedFromIframe) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const script = document.createElement('script');
|
const script = document.createElement('script');
|
||||||
script.src = securePrivacyScriptUrl;
|
script.src = securePrivacyScriptUrl;
|
||||||
script.async = true;
|
script.async = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue