Skip to content

Instantly share code, notes, and snippets.

@jasonschroeder
Created August 11, 2012 05:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonschroeder/3321596 to your computer and use it in GitHub Desktop.
Save jasonschroeder/3321596 to your computer and use it in GitHub Desktop.
requestFileSystemSync returns null on BlackBerry 10.0.0.6
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" src="index.js"></script>
</head>
<body>
<a href="#" onclick="startWorker()">Start Worker</a>
<p>Watch console.log!</p>
</body>
</html>
function startWorker() {
var worker = new Worker('/worker.js');
worker.onmessage = function(e) {
console.log(e.data);
};
worker.postMessage({});
}
self.requestFileSystemSync = self.webkitRequestFileSystemSync ||
self.requestFileSystemSync;
onmessage = function(e) {
var fs = requestFileSystemSync(PERSISTENT, 10 /*10 bytes*/);
if (fs == null)
postMessage('FS is null (unexpected)');
else
postMessage('FS is not null (expected)');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment