1 // Copyright (c) 2012 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 5 // Called when a message is passed. We assume that the content script 6 // wants to show the page action. 7 function onRequest(request, sender, sendResponse) { 8 // Show the page action for the tab that the sender (content script) 9 // was on. 10 chrome.pageAction.show(sender.tab.id); 11 12 // Return nothing to let the connection be cleaned up. 13 sendResponse({}); 14 }; 15 16 // Listen for the content script to send a message to the background page. 17 chrome.extension.onRequest.addListener(onRequest); 18