diff options
Diffstat (limited to 'js/vapi-core.js')
-rw-r--r-- | js/vapi-core.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/js/vapi-core.js b/js/vapi-core.js index bc7bcb9..4ab5216 100644 --- a/js/vapi-core.js +++ b/js/vapi-core.js @@ -34,6 +34,27 @@ const {Services} = Cu.import('resource://gre/modules/Services.jsm', null); let vAPI = self.vAPI = self.vAPI || {}; + + vAPI.modernFirefox = + Services.appinfo.ID === '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}' + && Services.vc.compare(Services.appinfo.version, '44') > 0; + + vAPI.app = { + name: 'eMatrix', + version: location.hash.slice(1), + + start: function () { + return; + }, + stop: function () { + return; + }, + restart: function () { + Cc['@mozilla.org/childprocessmessagemanager;1'] + .getService(Ci.nsIMessageSender) + .sendAsyncMessage(location.host + '-restart'); + }, + }; // List of things that needs to be destroyed when disabling the extension // Only functions should be added to it @@ -106,4 +127,14 @@ frameModule.contentObserver.unregister(); Cu.unload(frameModuleURL); }); + + vAPI.noTabId = '-1'; + + vAPI.isBehindTheSceneTabId = function (tabId) { + return tabId.toString() === '-1'; + }; + + vAPI.lastError = function () { + return null; + }; })(); |