fix key server url in manifest permissions

This commit is contained in:
Tankred Hase 2014-01-23 14:52:46 +01:00
parent f442cf1f5b
commit 2767dd0d04
3 changed files with 7 additions and 3 deletions

View File

@ -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) {

View File

@ -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) {}

View File

@ -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",