forked from zombieFox/nightTab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion.js
More file actions
54 lines (46 loc) · 974 Bytes
/
Copy pathversion.js
File metadata and controls
54 lines (46 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
var version = (function() {
var current = "5.67.0";
var name = "Jaded Raven";
var compare = function(a, b) {
var pa = a.split(".");
var pb = b.split(".");
for (var i = 0; i < 3; i++) {
var na = Number(pa[i]);
var nb = Number(pb[i]);
if (na > nb) {
return 1;
};
if (nb > na) {
return -1;
};
if (!isNaN(na) && isNaN(nb)) {
return 1;
};
if (isNaN(na) && !isNaN(nb)) {
return -1;
};
};
return 0;
};
var get = function() {
// return chrome.runtime.getManifest().version;
return {
number: current,
name: name
};
};
var render = function() {
helper.e(".display-version").textContent = get().number;
helper.e(".display-name").textContent = get().name;
};
var init = function() {
render();
};
// exposed methods
return {
init: init,
get: get,
compare: compare,
render: render
};
})();