diff --git a/src/js/dial.js b/src/js/dial.js index ef41db3..9592e69 100644 --- a/src/js/dial.js +++ b/src/js/dial.js @@ -79,10 +79,22 @@ app.Messages.init = function(){ }); }; app.Messages.getSettings = function(callback){ - browser.runtime.sendMessage({ cmd: app.Messages.Commands.getSettings }).then(callback, callback); + browser.runtime.getBackgroundPage().then(function(page){ + if(page){ + if(callback) callback(page.app.settings); + } else { + browser.runtime.sendMessage({ cmd: app.Messages.Commands.getSettings }).then(callback, callback); + } + }); }; app.Messages.getNode = function(path, callback){ - browser.runtime.sendMessage({ cmd: app.Messages.Commands.getNode, path: path }).then(callback); + browser.runtime.getBackgroundPage().then(function(page){ + if(page){ + if(callback) callback(page.app.GridNodes.getNode(page.app.node, dial.path.substr(1))); + } else { + browser.runtime.sendMessage({ cmd: app.Messages.Commands.getNode, path: path }).then(callback); + } + }); }; app.Messages.setNodeIndex = function(index, newIndex, callback){ browser.runtime.sendMessage({ cmd: app.Messages.Commands.setNodeIndex, path: dial.path, index: index, newIndex: newIndex }).then(callback); diff --git a/src/manifest.json b/src/manifest.json index 52a17e9..785cdfc 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "Quick Dial", - "version": "0.1.4", + "version": "0.1.4", "author": "MatMoul", "homepage_url": "https://github.com/MatMoul/quickdial-webext", "developer": {