Skip to content

Instantly share code, notes, and snippets.

@hbt
Created December 25, 2016 14:32
Show Gist options
  • Save hbt/8ffcdc16bf929ba93492e068ee046c96 to your computer and use it in GitHub Desktop.
Save hbt/8ffcdc16bf929ba93492e068ee046c96 to your computer and use it in GitHub Desktop.
chrome.runtime.getPackageDirectoryEntry(function (dir) {
window.dir = dir;
console.log(dir)
dir.getFile('version.txt', {}, function (fe) {
/**
* @var File file
*/
fe.file(function (file) {
if (file.lastModified > lastModified) {
chrome.runtime.reload();
}
//var lastModified = file.lastModified;
//console.log(lastModified)
//var reader = new FileReader();
//reader.onloadend = function (e) {
// //var txtArea = document.createElement('textarea');
// //txtArea.value = this.result;
// //document.body.appendChild(txtArea);
// console.log(this.result)
//};
//
//var gg = reader.readAsText(file);
//console.log('gg', gg)
//
}, null);
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment