(repost - stupid gmail)

On Mon, Apr 27, 2009 at 10:20 AM, Aaron Boodman <[email protected]> wrote:

> 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.


What does using a page ID buy us over using an URL directly?




> 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".
>  }
> ]
>

I like this way of pre-defining the page actions via the manifest.  As you
said, it simplifies the API, but I think it also gives us more opportunities
for caching, and will likely improve performance of the feature in general.
 It appears you're missing the icon though.  I'm not sure you need the
'type' field in the pre-definition though since the API calls will provide
that implicitly.



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


I can't think of an example where you'd need 'type' passed back to you, but
you do need the pageActionId.

If we use a pageID here, then how is that used by the developer?  Do they
need to make a round-trip to look up the URL associated with it?  Or are
they supposed to keep a local map of recent pageID to URL?




> void chromium.pageActions.enableTemporary(int tabID)  // or history/pageID?
>
> I think this is all the API we would need for a v1.



Yep.

Erik

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

Reply via email to