Created
          December 25, 2016 14:32 
        
      - 
      
- 
        Save hbt/8ffcdc16bf929ba93492e068ee046c96 to your computer and use it in GitHub Desktop. 
  
    
      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
    
  
  
    
  | 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