Skip to content

Commit

Permalink
Merge pull request #212 from positivecrash/main
Browse files Browse the repository at this point in the history
iframe
  • Loading branch information
positivecrash authored Jun 7, 2024
2 parents f48e25b + 279be9b commit 5fa4348
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions src/pages/demoapps/johnnyb-lab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</section>

<section class="container__mid">
<iframe id="appframe" src="https://johnnyb-lab.robonomics.academy" sandbox="allow-forms allow-scripts allow-cross-origin" referrerpolicy="cross-origin" scrolling="no" />
<iframe id="appframe" src="https://johnnyb-lab.robonomics.academy" sandbox="allow-forms allow-scripts allow-same-origin" referrerpolicy="strict-origin-when-cross-origin" scrolling="no" />
</section>
</Layout>
</template>
Expand All @@ -36,24 +36,27 @@ export default {
MetaInfo: () => import('~/components/MetaInfo.vue')
},
// methods: {
// resizeIframe() {
// if (typeof document !== 'undefined') {
// try{
// const iframe = document.getElementById("appframe");
// if(iframe) {
// iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px';
// }
// } catch(e) {
// console.log(e);
// }
// }
// }
// },
methods: {
resizeIframe() {
if (typeof document !== 'undefined') {
try{
const iframe = document.getElementById("appframe");
if(iframe) {
const iframeinner = (iframe.contentDocument)
? iframe.contentDocument
: iframe.contentWindow.document;
iframe.style.height = iframeinner.body.scrollHeight + 'px';
}
} catch(e) {
// console.log(e);
}
}
}
},
// mounted() {
// window.addEventListener('resize', this.resizeIframe);
// },
mounted() {
window.addEventListener('resize', this.resizeIframe);
},
}
Expand Down

0 comments on commit 5fa4348

Please sign in to comment.