Restore "don't run SP script on iframe (368)" + lint/format (#373)

This commit is contained in:
infinite-persistence 2021-11-26 06:24:51 -08:00 committed by GitHub
parent 406d91948d
commit 56ecdec2cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -332,6 +332,18 @@ function App(props: Props) {
// add secure privacy script
useEffect(() => {
function inIframe() {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
}
if (inIframe()) {
return;
}
const script = document.createElement('script');
script.src = securePrivacyScriptUrl;
script.async = true;