Do you mean you're having trouble getting a page action to show up on the
new tab page, but only the new tab page? Having something like the following
in your background page should do the trick:
<script>
function showOrHide(tab) {
if (tab.url == "chrome://newtab/") {
chrome.pageAction.show(tab.id);
} else {
chrome.pageAction.hide(tab.id);
}
}
chrome.tabs.onCreated.addListener(showOrHide);
chrome.tabs.onUpdated.addListener(function(tabid, changeinfo, tab) {
showOrHide(tab);
});
</script>
On Wed, Dec 9, 2009 at 6:43 AM, The Enthusiastic Student <
[email protected]> wrote:
> Is it possible to make a pageAction extension available in a newly
> created tab?
> With the onSelectionChanged and getSelected methods I can make the
> extension visible once I've changed to another tab and back again, but
> a newly created tab does not show it.
> With the onCreated method the icon is briefly visible and then
> promptly disappears.
> I've tried to use the tabs.status to detect if the tab is loading and
> then show the icon once the status changes to complete, however I
> couldn't get this to work.
> Currently I am detecting that it is a new tab by checking if the
> tab.title is equal to "New Tab".
>
> For those interested I am trying to create an extension which launches
> certain websites and logs in. Sort of a morning coffee thing. A user
> would start up Chrome which starts with the "New Tab" tab instead of
> opening all the different sites individually the user simply clicks
> the extension which opens the sites in new tabs.
>
> Regards
>
> The Enthusiastic Student
>
> --
>
> 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]<chromium-extensions%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/chromium-extensions?hl=en.
>
>
>
--
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.