-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackground.html
36 lines (34 loc) · 1.62 KB
/
background.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
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/underscore.min.js"></script>
<script type="text/javascript" src="js/backbone.min.js"></script>
<script type="text/javascript" src="js/backbone-localstorage.js"></script>
<script type="text/javascript" src="js/trac.js"></script>
<script type="text/javascript">
// This event is fired each time the user updates the text in the omnibox,
// as long as the extension's keyword mode is still active.
chrome.omnibox.onInputChanged.addListener(
function(text, suggest) {
console.log('inputChanged: ' + text);
suggest([
{content: text + " one", description: "the first one"},
{content: text + " number two", description: "the second entry"}
]);
});
// This event is fired with the user accepts the input in the omnibox.
chrome.omnibox.onInputEntered.addListener(
function(text) {
if (text == '') {
chrome.tabs.create({url : 'trac.html'});
} else {
if (Trac(text)) {
//localStorage.setItem(“trac-last-action”, text);
var notification = webkitNotifications.createHTMLNotification('timer.html');
notification.show();
setTimeout(function() {
//notification.cancel();
}, 3000);
}
}
});
</script>