So Finnur is looking at the Page Actions API
(http://dev.chromium.org/developers/design-documents/extensions/page-actions-api).
Right now, the proposed API for creating one of these bad boys is:

create({string name, [string javascript], [string faviconUrl], [bool
executeInPage]}, [function callback(PageAction new)])


I would like to change two main things about this:

a) Usually page actions are associated with a tab. When you switch
tabs, they should automatically be switched. The extension developer
shouldn't have to manually manage that. There are also page actions
which apply to every page, but we could support that separately.

b) I would like the callback to be in the form of a function, not a
string of JavaScript. Functions are better because they can have
closures that allow you to keep references to local state, and are
just more JavaScripty in general.


So I would change it to something like:

create({string name, int tabId, string iconUrl, function onExecute()},
[function callback(PageAction new)])

Note that the second callback is just basically telling you "yes, it
was registered!". There would eventually be a third optional callback
for errors ("no, that tab id doesn't even exist!").


Thoughts on these changes? It would require some changes to enable
ExtensionFunctions to have lifetimes beyond the stack frame, but I
think that is a good thing because we want to support this style of
API for other things in the future, like navigation or history
searches.


- a

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to