12345678910111213141516171819202122232425 |
- /**
- * @Author HonorLee (dev@honorlee.me)
- * @Version 1.0 (2019-04-21)
- * @License MIT
- */
- var mainWidth = 600,mainHeight = 800;
- var wordDataArr,wordDataObj,wordOpt,currentWord;
- chrome.storage.local.get(['wordsArr','wordsObj','wordOpt'],function(items){
- wordDataArr = items.wordsArr?items.wordsArr:[];
- wordDataObj = items.wordsObj?items.wordsObj:{};
- wordOpt = items.wordOpt?items.wordOpt:{};
- });
- chrome.app.runtime.onLaunched.addListener(function() {
- chrome.app.window.create('windows/main.html', {
- id:'main',
- innerBounds:{width:mainWidth,height:mainHeight},
- resizable:false,
- // frame:{type:'none'}
- },function(mainWindow){
- mainWindow.resizeTo(mainWidth,mainHeight);
- mainWindow.onClosed.addListener(function(){
- chrome.storage.local.set({wordsArr:wordDataArr,wordsObj:wordDataObj,wordOpt:wordOpt});
- });
- });
- });
|