Closed Bug 581351 Opened 14 years ago Closed 14 years ago

tabs module documentation mentions nonexistent tab.activate() method

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mcepl, Assigned: adw)

Details

Attachments

(1 file)

When having this function:

        tabs.open({
            url: urlStr,
            inBackground: true,
            onOpen: function (t) {
                console.log("t = " + t.__proto__);
                console.log("t = " + t.activate);
                //t.activate();
            }
        });

I get this on stdout:

info: t = [object Object]
info: t = undefined

What's going on here? Per http://127.0.0.1:8888/#module/jetpack-core/tabs activate should be defined:

activate()

Make the tab the active tab in its containing window.
Thanks Matej.  tab.activate() doesn't actually exist, so this is a documentation error.  To make a tab become active, set the tabs.activeTab property:

  tabs.open({
    url: urlStr,
    inBackground: true,
    onOpen: function (t) {
      tabs.activeTab = t;
    }
  });

Morphing bug accordingly.
OS: Linux → All
Hardware: x86_64 → All
Summary: tab parameter of tabs.open method is undefined → tabs module documentation mentions nonexistent tab.activate() method
Since activating tabs is pretty common for many extensions (I would think), I think we should respin 0.6 for this.
Attachment #459816 - Flags: review?(myk)
BTW, I realize your example has probably been pared down, but if you really want to open a tab and have it focused, set `inBackground` to false or just leave it out altogether.
(In reply to comment #3)
> BTW, I realize your example has probably been pared down, but if you really
> want to open a tab and have it focused, set `inBackground` to false or just
> leave it out altogether.

well, I would love the tab be loaded on the background (it is a bugzilla query, so it can take some time) and activate when done.
thanks for the information though
Comment on attachment 459816 [details] [diff] [review]
documentation patch

r=myk and a=myk for checkin during the freeze.
Attachment #459816 - Flags: review?(myk) → review+
This sucks.  However, I don't think it rises to the level of a blocker that would force a respin.  Nevertheless, we should definitely get it in if we do respin (and otherwise note it as a known issue in the release notes).
http://hg.mozilla.org/labs/jetpack-sdk/rev/acad6c7715c5
Assignee: nobody → adw
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
The Add-on SDK is no longer a Mozilla Labs experiment and has become a big enough project to warrant its own Bugzilla product, so the "Add-on SDK" product has been created for it, and I am moving its bugs to that product.

To filter bugmail related to this change, filter on the word "looptid".
Component: Jetpack SDK → General
Product: Mozilla Labs → Add-on SDK
QA Contact: jetpack-sdk → general
Version: Trunk → unspecified
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: