Skip to content

Instantly share code, notes, and snippets.

@ItsOnlyBinary
Created October 18, 2023 19:54
Show Gist options
  • Save ItsOnlyBinary/6c5c307831dc1dbc9b5dbf1abd663721 to your computer and use it in GitHub Desktop.
Save ItsOnlyBinary/6c5c307831dc1dbc9b5dbf1abd663721 to your computer and use it in GitHub Desktop.
plugin-embed-restrict.html
<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