Prevent mounting the volume after sign out and signing in again.

'persistent' parameter is added by
https://chromium-review.googlesource.com/c/chromium/src/+/792692
and will be available from Chrome version 64.

BUG=chromium:789073
TEST=Confirmed that zip files mounted in the prev session was not mounted after restart.
Change-Id: Ib255fd364a714947da54ba7e1e2a3d9785d22b94
diff --git a/unpacker/js/app.js b/unpacker/js/app.js
index 21182a1..dba7e54 100644
--- a/unpacker/js/app.js
+++ b/unpacker/js/app.js
@@ -781,12 +781,14 @@
                 // Mount the volume and save its information in local storage
                 // in order to be able to recover the metadata in case of
                 // restarts, system crashes, etc.
-                chrome.fileSystemProvider.mount({
+                const mountOptions = {
                   fileSystemId: fileSystemId,
                   displayName: entry.name,
                   openedFilesLimit: 1
-                },
-                function() {
+                };
+                if (unpacker.app.getChromeMajorVersion_() >= 64)
+                  mountOptions.persistent = false;
+                chrome.fileSystemProvider.mount(mountOptions, function() {
                   if (chrome.runtime.lastError) {
                     onError(chrome.runtime.lastError, fileSystemId);
                     return;
@@ -836,5 +838,16 @@
    */
   onSuspend: function() {
     unpacker.app.saveState_(Object.keys(unpacker.app.volumes));
+  },
+
+  /**
+   * Gets the major version number of Chrome currently running.
+   * @private
+   * @return {number}
+   */
+  getChromeMajorVersion_: function() {
+    const r = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)/);
+    console.assert(r, 'Failed to identify Chrome version.');
+    return parseInt(r[2]);
   }
 };