Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After Firefox start group bar is empty #18

Open
mnn opened this issue Mar 9, 2014 · 4 comments
Open

After Firefox start group bar is empty #18

mnn opened this issue Mar 9, 2014 · 4 comments

Comments

@mnn
Copy link

mnn commented Mar 9, 2014

In browser console is TypeError: contentWindow is null on line 176 of tabgroupbar.js

relevant code:
let groupItems = contentWindow.GroupItems.groupItems; in objTabGroupBar.addGroupTabs

@mnn
Copy link
Author

mnn commented Mar 9, 2014

I modified (hacked) that function and it seems to be working. Be warned - consider my solution only as a temporary workaround (I have no deeper understanding of that code, I cannot say if it won't affect some other stuff).

// Puts the tabs on the main bar
objTabGroupBar.addGroupTabs = function() {
    if (typeof this.getTabView === "function") this.tabView = this.getTabView(); // monnef fix
    if (this.tabView == null) return; // monnef fix
    let contentWindow = this.tabView.getContentWindow();
    if (contentWindow == null) return; // monnef fix
    let groupItems = contentWindow.GroupItems.groupItems;
    let activeGroup = contentWindow.GroupItems.getActiveGroupItem();
    for (let i = 0; i < groupItems.length; i++) {
        this.addGroupTab(groupItems[i]);
        groupItems[i].addSubscriber("close", this.reloadGroupTabs);
        this.tabsLoaded = true;
        if (groupItems[i] == activeGroup) {
            this.tabsContainer.selectedItem = this.tabsContainer.lastChild;
        }
    }
};

@mnn
Copy link
Author

mnn commented Mar 21, 2014

Alright, my previous code just suppresses showing errors but doesn't actually fix anything. I forked it and tried to make it working (and now it, for most part, is). If creator or anyone else is interested, then here you go -> https://github.com/mnn/Tab-Group-Bar.

@Newbiez
Copy link

Newbiez commented Jun 10, 2014

Please note that the 'this' object at startup points not to the "expected" container (object object). It points to window object in this context.

TypeError: contentWindow is null tabgroupbar.js:1xx
"Preference change" tabgroupbar.js:xx
TypeError: this.addGroupTab is not a function tabgroupbar.js:1xx
"1:[object ChromeWindow]" tabgroupbar.js:1xx

The 'this' reference should be used as rarely as possible. Please use the container object generally instead 'this' to avoid these side effects. Please recheck.

@BrenBarn
Copy link

I've taken a few stabs at this bug, but it's very difficult to pin down. I've thought that I fixed it a few times but it popped up again. The behavior isn't reproducible in any straightforward way --- sometimes it fails to load, sometimes it doesn't. This makes it hard to know whether a solution really works or the problem just stopped by coincidence. There may also be some interference from the Tab Mix Plus extension, which apparently also tries to hook into tab group loading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants