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: [email protected]
For additional commands, e-mail: [email protected]