On Sat, Jan 9, 2010 at 2:44 PM, hexid <[email protected]> wrote: > hmm...I know how to do this on a page_action...not sure about a > browser_action > > in your 'popup.html' or whatever you named the page_action popup to > be...add: > > <script type="text/javascript"> > chrome.tabs.create({url: 'options.html'}); > window.close(); > </script> > > and change the url to whatever you want it to open...i have my code so > that in the options, the user can show/hide the page_action when i > apply an update... > the above code will open the options page in a new tab and close the > popup when you click it...
Hey Nick, the extra steps of opening and closing a popup aren't necessary. Using a background page, you can add a listener for the "onClicked" event on either the browser or page action. In Beeraj's case, a click on the browser action could trigger content injection in the selected tab by sending a message to a content script or running "chrome.tabs.executeScript()". In your case, a click on the page action could trigger the creation of the new tab.
-- You received this message because you are subscribed to the Google Groups "Chromium-extensions" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/chromium-extensions?hl=en.
