On Mon, Apr 27, 2009 at 9:26 AM, Erik Kay <[email protected]> wrote:
> I think these changes are an improvement, however it does feel a bit weird
> for it to be tab-based rather than URL based.  With only a tab id, I think
> there will be some races.  So if an extension script realizes that this page
> is special and should have a PageAction created, it calls the API, but as it
> does that, the tab navigates.  Since all the API has is a tab id, there's no
> way for the browser to know whether the request is still valid or not.
>  We'll likely continue to need a tab id as well since you could have
> multiple tabs open to the same URL.

Wow, this is a great point, thanks for bringing it up. It seems like a
better solution would be to introduce the concept of history or page
or something. That is really the object you want to point to. Each tab
would have a history or page ID, and this is what you would send into
this API.

Separately, I was thinking over the weekend that we could simplify
this API and consolidate the temporary and permanent versions like
this:

// Manifest
"page_actions": [
  {
    "id": "foo",  // Required. Chosen by the developer,
namespaced/unique by extension
    "title": "Add to delicious...",  // Required.
    "type": "temporary"  // Optional, "temporary" or "permanent".
Defaults to "permanent".
  }
]

// API
event chromium.pageActions.onExecute(int tabID, string type) // or
history/pageID?
void chromium.pageActions.enableTemporary(int tabID)  // or history/pageID?

I think this is all the API we would need for a v1.

- 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