diff --git a/Gruntfile.js b/Gruntfile.js index 56e7405..2553a2f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -278,7 +278,7 @@ module.exports = function(grunt) { suffix: ' (Alpha)', version: version, deleteKey: true, - keyServer: 'https://keys.whiteout.io' + keyServer: 'https://keys.whiteout.io/' }); }); @@ -297,7 +297,7 @@ module.exports = function(grunt) { manifest.oauth2.client_id = options.client_id; } if (options.keyServer) { - var ksIndex = manifest.permissions.indexOf('https://keys-test.whiteout.io'); + var ksIndex = manifest.permissions.indexOf('https://keys-test.whiteout.io/'); manifest.permissions[ksIndex] = options.keyServer; } if (options.deleteKey) { diff --git a/src/js/app-config.js b/src/js/app-config.js index 616ae38..7cf5889 100644 --- a/src/js/app-config.js +++ b/src/js/app-config.js @@ -8,9 +8,13 @@ define(function(require) { // parse manifest to get configurations for current runtime try { var manifest = chrome.runtime.getManifest(); + // get key server base url cloudUrl = _.find(manifest.permissions, function(permission) { return typeof permission === 'string' && permission.indexOf('https://keys') === 0; }); + // remove last '/' from url due to required syntax in manifest + cloudUrl = cloudUrl.substring(0, cloudUrl.length - 1); + // get client ID for OAuth requests clientId = manifest.oauth2.client_id; } catch (e) {} diff --git a/src/manifest.json b/src/manifest.json index 4a81d02..275c05e 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -12,7 +12,7 @@ "fileSystem": ["write"] }, "notifications", - "https://keys-test.whiteout.io", + "https://keys-test.whiteout.io/", "identity", { "socket": [ "tcp-connect:imap.gmail.com:993",