Created
October 18, 2023 19:54
-
-
Save ItsOnlyBinary/6c5c307831dc1dbc9b5dbf1abd663721 to your computer and use it in GitHub Desktop.
plugin-embed-restrict.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template id="embed-restrict"> | |
<div class="embed-restrict"> | |
{{ message }} | |
</div> | |
</template> | |
<script> | |
kiwi.plugin('embed-restrict', function(kiwi, log) { | |
if (window === window.top) { | |
return; | |
} | |
const restrictedDomains = [ | |
'localhost', | |
]; | |
if (!restrictedDomains.some(d => document.referrer.includes(d))) { | |
return; | |
} | |
const component = { | |
template: '#embed-restrict', | |
data() { | |
return { | |
message: 'Embedding is restricted for this domain', | |
}; | |
}, | |
}; | |
kiwi.replaceModule('components/startups/Welcome', component); | |
}); | |
</script> | |
<style> | |
.embed-restrict { | |
display: flex; | |
width: 100%; | |
height: 100%; | |
align-items: center; | |
justify-content: center; | |
font-size: 40px; | |
font-weight: 900; | |
color: rgb(150, 0, 0); | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment