Git Product home page Git Product logo

vue-capacitor-iframe-android's Introduction

vue-capacitor-iframe-android

Example project that reproduces github issue 6377

Issue description

This project has two iframes set side by side: the leftmost iframe's src is set as a URL.createObjectURL from a blob, the righmost iframe src is set as a base64 encoded string with the contents of that same blob. ####Issue: The leftmost frame is not rendered in Android but renders in Web (browser).

<template>
  <div class="h-screen flex items-center space-x-2 justify-center bg-gray-500">
    <iframe class="w-[250px] h-[250px] bg-white" :src="src" />
    <iframe v-if="src2 !== null" class="w-[250px] h-[250px] bg-white" :src="src2" />
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
const blob = new Blob(
  [
    '<div style="display: flex; align-items: center; justify-content: center; height: 100%; font-size: 1.5rem;">IFRAME CONTENT SHOWN</div>'
  ],
  { type: 'text/html' }
)
const src = URL.createObjectURL(blob)
const src2 = ref<string | null>(null)
;(async () => {
  src2.value = `data:text/html;base64,${btoa(await blob.text())}`
})()
</script>


In Android, setting the iframe src with a URL.createObjectURL will result on an empty iframe as follows: Empty android iframe

Android behavior

The same code on a browser will render the Iframe as expected:

Web iframe

Web behavior

###Expected behavior: Leftmost iframe renders in Android and Web.

vue-capacitor-iframe-android's People

Watchers

Paulo dos Santos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.