title: How do I make page_action appear for specific pages?
body: <p>I was playing around with some chrome extensions and I found this example:<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/pageAction/pageaction_by_url/" rel="noreferrer">http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/pageAction/pageaction_by_url/</a></p>
  
  <p>Everything works fine, but I want to create my own extension and I want to see the page_action Icon  on a specific site, not ones with 'g' in their urls.
  So I tried simply to change the script from this:</p>
  
  <pre><code>// 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.
  
  // Called when the url of a tab changes.
  function checkForValidUrl(tabId, changeInfo, tab) {
  // If the letter 'g' is found in the tab's URL...
  if (tab.url.indexOf('g') &gt; -1) {
  // ... show the page action.
  chrome.pageAction.show(tabId);
  }
  };
  
  // Listen for any changes to the URL of any tab.
  chrome.tabs.onUpdated.addListener(checkForValidUrl);
  </code></pre>
  
  <p>Into this:</p>
  
  <pre><code>chrome.pageAction.show(tabId);
  </code></pre>
  
  <p>But now it doesn't work...
  I don't get it. Obviously I can use a workaround, but that's not the point... First of all, must I create a background page to do this? I think yes but I can't see why, and why the .show method doesn't work alone?
  I tried to search in the google documentation and stuff, but I couldn't find anything useful  I'm no expert and this has been my first afternoon spent on google extension, but how should I know that the "chrome.page.show(tabId)" must go in a background page if it's not written anywhere? No intent to criticize, but how the hell did you guys find out? All chrome methods must go in a background page?
  Well, definitely much more questions then what its legit. Hope you can give me at least one answer!</p>