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
|
||||
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');
|
||||
script.src = securePrivacyScriptUrl;
|
||||
script.async = true;
|
||||
|
|
Loading…
Reference in a new issue