Panorama:TabGroupsAPI: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 6: Line 6:


<pre>
<pre>
{
{windows: [{
   windows: [
   tabs: [
     { tabs: [{ url: "about:blank#1" }] },
     {entries: [{url: "http://example.com/#1"}], extData: {"tabgroups": "{\"group\": \"group1-id\"}"}},
     { tabs: [{ url: "about:blank#2" }], type: "set", extData: { panorama: "{bounds: {width: 200, height: 200}}" } }
     {entries: [{url: "http://example.com/#2"}], extData: {"tabgroups": "{\"group\": \"group2-id\"}"}}
   ],
   ],
   closedWindows: [ { tabs: [{ url: "about:blank#3" }], type: "set" } ]
   extData: {"tabgroups": "{\"group1-id\": {\"id\": \"group1-id\", \"title\": \"first title\"}," +
}
                          "\"group2-id\": {\"id\": \"group2-id\", \"title\": \"second title\"}}"}
}]}
</pre>
</pre>



Revision as of 11:22, 4 September 2011

Schema

Compatibility

Example

{windows: [{
  tabs: [
    {entries: [{url: "http://example.com/#1"}], extData: {"tabgroups": "{\"group\": \"group1-id\"}"}},
    {entries: [{url: "http://example.com/#2"}], extData: {"tabgroups": "{\"group\": \"group2-id\"}"}}
  ],
  extData: {"tabgroups": "{\"group1-id\": {\"id\": \"group1-id\", \"title\": \"first title\"}," +
                          "\"group2-id\": {\"id\": \"group2-id\", \"title\": \"second title\"}}"}
}]}

API Description

TabGroups
  [Methods]
    createGroup(DOMWindow aWindow)
    getGroups()
    getGroupsByWindow(DOMWindow aWindow)

  [Events]
    tabgroup-added
    tabgroup-removed
    window-closing

TabGroup
  [Properties]
    id : string
    title : string
    tabs : xulTab[]
    storage : object

  [Methods]
    addTab(xulTab aTab)
    removeTab(xulTab aTab)
    close()

  [Events]
    rename
    tab-added
    tab-removed
    close