MattermostのURLをユーザーごとの設定フォルダに保存するように変更

This commit is contained in:
Yuya Ochiai
2015-10-09 22:50:48 +09:00
parent 6de38f9b32
commit e86c7f31f6
4 changed files with 55 additions and 2 deletions

View File

@@ -5,6 +5,19 @@ var url = require('url');
var webView = document.getElementById('mainWebview');
try{
var configFile = remote.require('app').getPath('userData') + '/config.json';
var config = require(configFile);
if(config.url){
webView.setAttribute('src', config.url);
}
else{
throw 'URL is not configured';
}
}catch(e){
window.location.href = './settings.html';
}
webView.addEventListener('page-title-set', function(e){
document.title = e.title;
});