Created
May 22, 2015 15:56
-
-
Save cosenal/314d475d9c200db0bdda to your computer and use it in GitHub Desktop.
device storage -- minimum working example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var files = navigator.getDeviceStorage('pictures'); | |
var cursor = files.enumerate(); | |
console.log(cursor); | |
cursor.onsuccess = function() { | |
if (this.done) { | |
console.log("Done"); | |
} | |
else { | |
console.log(this.result); | |
this.continue(); | |
} | |
}; | |
cursor.onerror = function() { | |
console.log(cursor.error); | |
}; | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" ng-app="uploadApp"> | |
<head> | |
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1" /> | |
<meta charset="utf-8"> | |
<title>Device Storage MWE</title> | |
<script type="text/javascript" src="app.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Device Storage MWE", | |
"description": "device storage MWE", | |
"launch_path": "/index.html", | |
"type": "privileged", | |
"permissions": { | |
"device-storage:pictures": { | |
"access": "readonly", | |
"description": "photo backup" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment