1<!DOCTYPE html> 2<!-- 3 * Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this 4 * source code is governed by a BSD-style license that can be found in the 5 * LICENSE file. 6--> 7<head> 8<title>Keyboard Pin</title> 9<script> 10chrome.extension.onRequest.addListener( 11 function(request, sender, sendResponse) { 12 if (request.toggle_pin) { 13 // Get the currently selected tab 14 chrome.tabs.getSelected(null, function(tab) { 15 // Toggle the pinned status 16 chrome.tabs.update(tab.id, {'pinned': !tab.pinned}); 17 }); 18 } 19 } 20); 21</script> 22</head> 23