-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpopup.html
137 lines (112 loc) · 3.97 KB
/
popup.html
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<html>
<head>
<style type="text/css">
body
{
overflow-x: hidden;
color: black;
width: 300px;
margin: 10px;
font-size: 16px;
line-height: 1.5;
font-family: Tahoma;
}
</style>
<script src="jquery-1.7.2.min.js"></script>
<script>
// defines
var os_names = {
'win' : 'Windows',
'mac' : 'MacOS',
'linux' : 'Linux',
'linux64' : 'Linux 64 bit'
}
var os_directories = new Array();
var os_archives = new Array();
var base_url = 'http://commondatastorage.googleapis.com/chromium-browser-continuous/';
// latest
// base_url + os_directories[os] + 'LAST_CHANGE'
// download link
// base_url + os_directories[os] + 'chrome-" + os_archives['win']
// Linux
// http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/LAST_CHANGE
// http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/141209/chrome-linux.zip
os_directories['linux'] = 'Linux/';
os_archives['linux'] = 'linux.zip';
// Linux 64 bit
// http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux_x64/LAST_CHANGE
// http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux_x64/141209/chrome-linux.zip
os_directories['linux64'] = 'Linux_x64/';
os_archives['linux64'] = 'linux.zip';
// Windows
// http://commondatastorage.googleapis.com/chromium-browser-continuous/Win/LAST_CHANGE
// http://commondatastorage.googleapis.com/chromium-browser-continuous/Win/141182/chrome-win32.zip
os_directories['win'] = 'Win/';
os_archives['win'] = 'win32.zip';
// Mac OS
// http://commondatastorage.googleapis.com/chromium-browser-continuous/Mac/LAST_CHANGE
// http://commondatastorage.googleapis.com/chromium-browser-continuous/Mac/141204/chrome-mac.zip
os_directories['mac'] = 'Mac/';
os_archives['mac'] = 'mac.zip';
// variables
var os = "unknown";
$(document).ready(function () {
$("#latest").html("<img src=\"loading.gif\" />");
if (navigator.appVersion.indexOf("Win")!=-1) os = 'win';
if (navigator.appVersion.indexOf("Mac")!=-1) os = 'mac';
if (navigator.appVersion.indexOf("X11")!=-1) os = 'x11';
if (navigator.appVersion.indexOf("Linux")!=-1) os = 'linux';
re = /Chrome\/(.*)\sSafari/g;
version_curr = re.exec(window.navigator.userAgent);
version_curr = version_curr[1];
$("#version").text("Chromium " + version_curr + " on " + os_names[os]);
var downloaded = "none";
if (localStorage['latest_download'])
{
downloaded = localStorage['latest_download'];
$("#downloaded").text(localStorage['latest_download']);
}
var latest;
$.get(base_url + os_directories[os] + 'LAST_CHANGE', function(data) {
latest = data;
$("#latest").text(latest);
if (latest != downloaded)
{
$("#result").text("");
if (downloaded == "none")
{
$("#result").append("You didn't download Chromium using this extension. Can't track revision.<br />");
}
$("#result").append("<a href=\"" + base_url + os_directories[os] + latest + "/chrome-" + os_archives[os] + "\">Download archive</a>");
if (os == "win")
{
$("#result").append("<br /><a href=\"" + base_url + os_directories[os] + latest + "/mini_installer.exe\">Download mini installer</a>");
}
$("#result a").click(function() {
window.open($(this).attr("href"));
localStorage['latest_download'] = latest;
});
}
else
{
$("#result").text("You are using latest Chromium build.");
}
});
});
</script>
</head>
<body>
<h3><center>Chromium Latest Build</center></h3>
Your version:<br />
<span id="version">Problem with jQuery / Your browser (^^)</span>
<br />
Downloaded:<br />
<span id="downloaded">none</span>
<br />
Latest available:<br />
<span id="latest">none</span>
<br />
<br />
<span id="result"></span>
</body>
</html>