Home | History | Annotate | Download | only in pageaction_by_content
      1 <!DOCTYPE html>
      2 <!--
      3  * Copyright (c) 2010 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 <html>
      8   <head>
      9     <script>
     10       // Called when a message is passed.  We assume that the content script
     11       // wants to show the page action.
     12       function onRequest(request, sender, sendResponse) {
     13         // Show the page action for the tab that the sender (content script)
     14         // was on.
     15         chrome.pageAction.show(sender.tab.id);
     16 
     17         // Return nothing to let the connection be cleaned up.
     18         sendResponse({});
     19       };
     20 
     21       // Listen for the content script to send a message to the background page.
     22       chrome.extension.onRequest.addListener(onRequest);
     23     </script>
     24   </head>
     25 </html>
     26