1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 window.addEventListener("keydown", function(event) { 5 // Bind to both command (for Mac) and control (for Win/Linux) 6 var modifier = event.ctrlKey || event.metaKey; 7 if (modifier && event.shiftKey && event.keyCode == 80) { 8 // Send message to background page to toggle tab 9 chrome.extension.sendRequest({toggle_pin: true}, function(response) { 10 // Do stuff on successful response 11 }); 12 } 13 }, false); 14