aboutsummaryrefslogtreecommitdiffstats
path: root/js/vapi-core.js
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2019-08-11 19:58:26 -0500
committerJesús <heckyel@hyperbola.info>2019-08-11 19:58:26 -0500
commit9ec39f09621c9975582a2b6d9a6fa0313b308086 (patch)
tree918786fdf371606f80bc9cdfbc2966909703e9bf /js/vapi-core.js
parent144581a54b8bb1808e23a3ea5c81e619e36a459f (diff)
downloadematrix-9ec39f09621c9975582a2b6d9a6fa0313b308086.tar.lz
ematrix-9ec39f09621c9975582a2b6d9a6fa0313b308086.tar.xz
ematrix-9ec39f09621c9975582a2b6d9a6fa0313b308086.zip
remove tabs in javascript files
Diffstat (limited to 'js/vapi-core.js')
-rw-r--r--js/vapi-core.js120
1 files changed, 60 insertions, 60 deletions
diff --git a/js/vapi-core.js b/js/vapi-core.js
index c2c508d..94ae599 100644
--- a/js/vapi-core.js
+++ b/js/vapi-core.js
@@ -27,26 +27,26 @@
(function (self) {
vAPI.modernFirefox =
- Services.appinfo.ID === '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}'
- && Services.vc.compare(Services.appinfo.version, '44') > 0;
+ 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');
- },
+ 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
// eMatrix: taken care by vAPI.addCleanUpTask --- use that function
@@ -57,75 +57,75 @@
let expectedNumberOfCleanups = 7;
vAPI.addCleanUpTask = function (task) {
- if (typeof task !== 'function') {
- return;
- }
+ if (typeof task !== 'function') {
+ return;
+ }
- cleanupTasks.push(task);
+ cleanupTasks.push(task);
};
vAPI.deferUntil = function (testFn, mainFn, details) {
- let dtls = (typeof details !== 'object') ? {} : details;
- let now = 0;
- let next = dtls.next || 200;
- let until = dtls.until || 2000;
+ let dtls = (typeof details !== 'object') ? {} : details;
+ let now = 0;
+ let next = dtls.next || 200;
+ let until = dtls.until || 2000;
- let check = function () {
+ let check = function () {
if (testFn() === true || now >= until) {
- mainFn();
- return;
+ mainFn();
+ return;
}
now += next;
vAPI.setTimeout(check, next);
- };
+ };
- if ('sync' in dtls && dtls.sync === true) {
+ if ('sync' in dtls && dtls.sync === true) {
check();
- } else {
+ } else {
vAPI.setTimeout(check, 1);
- }
+ }
};
window.addEventListener('unload', function () {
- // if (typeof vAPI.app.onShutdown === 'function') {
+ // if (typeof vAPI.app.onShutdown === 'function') {
// vAPI.app.onShutdown();
- // }
-
- // IMPORTANT: cleanup tasks must be executed using LIFO order.
- for (let i=cleanupTasks.length-1; i>=0; --i) {
- try {
- cleanupTasks[i]();
- } catch (e) {
- // Just in case a clean up task ends up throwing for
- // no reason
- console.error(e);
- }
- }
-
- // eMatrix: temporarily disabled
- // if (cleanupTasks.length < expectedNumberOfCleanups) {
+ // }
+
+ // IMPORTANT: cleanup tasks must be executed using LIFO order.
+ for (let i=cleanupTasks.length-1; i>=0; --i) {
+ try {
+ cleanupTasks[i]();
+ } catch (e) {
+ // Just in case a clean up task ends up throwing for
+ // no reason
+ console.error(e);
+ }
+ }
+
+ // eMatrix: temporarily disabled
+ // if (cleanupTasks.length < expectedNumberOfCleanups) {
// console.error
- // ('eMatrix> Cleanup tasks performed: %s (out of %s)',
+ // ('eMatrix> Cleanup tasks performed: %s (out of %s)',
// cleanupTasks.length,
// expectedNumberOfCleanups);
- // }
-
- // frameModule needs to be cleared too
- let frameModuleURL = vAPI.getURL('frameModule.js');
- let frameModule = {};
-
- Cu.import(frameModuleURL, frameModule);
- frameModule.contentObserver.unregister();
- Cu.unload(frameModuleURL);
+ // }
+
+ // frameModule needs to be cleared too
+ let frameModuleURL = vAPI.getURL('frameModule.js');
+ let frameModule = {};
+
+ Cu.import(frameModuleURL, frameModule);
+ frameModule.contentObserver.unregister();
+ Cu.unload(frameModuleURL);
});
vAPI.noTabId = '-1';
vAPI.isBehindTheSceneTabId = function (tabId) {
- return tabId.toString() === '-1';
+ return tabId.toString() === '-1';
};
vAPI.lastError = function () {
- return null;
+ return null;
};
})(this);