dont run on iframe (#368)

This commit is contained in:
mayeaux 2021-11-25 16:42:26 +01:00 committed by GitHub
parent fd17ab4c8b
commit 823fdcdd97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;