cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Randy Walsh (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CB-10021) window.requestFileSystem failing when inside of an iframe
Date Tue, 17 Nov 2015 01:57:11 GMT
Randy Walsh created CB-10021:
--------------------------------

             Summary: window.requestFileSystem failing when inside of an iframe
                 Key: CB-10021
                 URL: https://issues.apache.org/jira/browse/CB-10021
             Project: Apache Cordova
          Issue Type: Bug
          Components: Android, Plugin File
    Affects Versions: 5.2.0
         Environment: Android 5.1.1  Sony Tablet

            Reporter: Randy Walsh


The following simple code allows you to invoke the window.requestFileSystem.  The original
index.html code runs fine and you can click the "requestFileSystem" button multiple times
just fine.

However, when attempting to run the same code inside of an IFRAME, it fails.  Gives an uncaught
error: Java Exception in cordova.js:967 and 938.

Once a failure occurs, even the original requestFileSystem then starts failing.

Any and all help would be much appreciated!  Thank you in advance,

Randy Walsh


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <title>IFrame Bug</title>
   <script src="./js/jquery-2.1.1.min.js" type="text/javascript"></script>
   <script type="text/javascript" charset="utf-8" src="cordova.js"></script>

   <script>
      function getFileSystem() {
         window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fs) {
            alert("requestFileSystem succeeded ")

         }, function (err) {
            alert(err.message)
         });
      }
      function addIFrame() {
         $('<br />').appendTo('body');
         myIFrame = $('<iframe src="index.html" />').appendTo('body');
      }
   </script>
</head>

<body data-role="none">
   Hello
   <button type="button" class="Button" id="id" name="id" onclick="getFileSystem()">requestFileSystem</button>
   <button type="button" class="Button" id="id" name="id" onclick="addIFrame()">Add
an IFrame</button>
</body>
</html>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message