-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinject.js
24 lines (23 loc) · 895 Bytes
/
inject.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
window.addEventListener("keydown", function(event) {
// Bind to both command (for Mac) and control (for Win/Linux)
var modifier = event.ctrlKey || event.metaKey;
/*if (modifier && event.shiftKey && event.keyCode == 80) {
// Send message to background page to toggle tab
chrome.extension.sendRequest({toggle_pin: true}, function(response) {
// Do stuff on successful response
});
}*/
// -> 39
// <- 37
if (modifier && event.shiftKey && event.keyCode == 39) {
chrome.extension.sendRequest({isLeft: true}, function(response) {
});
}
if (modifier && event.shiftKey && event.keyCode == 37) {
chrome.extension.sendRequest({isLeft: false}, function(response) {
});
}
}, false);