]> git.wh0rd.org - chrome-ext/clearhistory-advance-fork.git/blob - javascript/background.js
clearhistory-1.5
[chrome-ext/clearhistory-advance-fork.git] / javascript / background.js
1 // Copyright 2013 Google Inc. All Rights Reserved.
2
3 /**
4 * @fileoverview Background initialization.
5 * @author arunjit@google.com (Arunjit Singh)
6 */
7
8 var CONSTANTS = {
9 /**
10 * The available time ranges (in hours). -1 => eternity.
11 * @type {Array.<number>}
12 * @const
13 */
14 TIMES: [-1, 1, 2, 24, 168],
15 /**
16 * The default time (in hours)
17 * @type {number}
18 * @const
19 */
20 DEFAULT_TIME: 1,
21 /**
22 * String for 'yes'. @see {@code CONSTANTS.NO}
23 * @type {string}
24 * @const
25 */
26 YES: 'yes',
27 /**
28 * String for 'no' that doesn't evaluate to a falsy value.
29 * @type {string}
30 * @const
31 */
32 NO: 'no'
33 };
34
35 /**
36 * Go to the options page on first run
37 */
38 if (!localStorage['options-set']) {
39 var optionsPageURL = chrome.extension.getURL('/views/options.html');
40 chrome.tabs.create({url: optionsPageURL});
41 localStorage['options-set'] = 1;
42 }