diff options
author | Alessio Vanni <vannilla@firemail.cc> | 2019-06-22 00:43:52 +0200 |
---|---|---|
committer | Alessio Vanni <vannilla@firemail.cc> | 2019-06-22 00:43:52 +0200 |
commit | 5befab2b81270d55e5cb45ed39756dd9c069cf1f (patch) | |
tree | e7feae67e4f84d25c79ec15877ec5ad5b2b54b11 /js/vapi-core.js | |
parent | 149164fed6a978ddc515107641cc29f5527340ae (diff) | |
download | ematrix-5befab2b81270d55e5cb45ed39756dd9c069cf1f.tar.lz ematrix-5befab2b81270d55e5cb45ed39756dd9c069cf1f.tar.xz ematrix-5befab2b81270d55e5cb45ed39756dd9c069cf1f.zip |
Move more entities to core
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; + }; })(); |