Unable to Close Tabs when "Open Tabs Relative" code is active in userChrome.js

RESOLVED DUPLICATE of bug 404499

Status

()

Core
JavaScript Engine
RESOLVED DUPLICATE of bug 404499
10 years ago
10 years ago

People

(Reporter: ronin.achilles, Unassigned)

Tracking

({regression})

Trunk
regression
Points:
---
Dependency tree / graph
Bug Flags:
blocking1.9 +

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9b2pre) Gecko/2007111923 Minefield/3.0b2pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9b2pre) Gecko/2007111923 Minefield/3.0b2pre

I use userChrome.js extension and have included the following code for "Tabs Open Relative" functionality (so basically open New Tabs or Links next to active tab):

/*::::::::::::::::::::::: Open Tabs Relative ::::::::::::::::::::::::*/

(function() {
getBrowser().__uc_addedTabs = 0;

eval("gBrowser.addTab = " + gBrowser.addTab.toString().replace(/\{/, "$& var __oldTabPos = this.mCurrentTab._tPos;").replace(/return /, "if (!blank) this.moveTabTo(t, __oldTabPos + 1 + this.__uc_addedTabs++); $&"));

eval("gBrowser.moveTabTo = " + gBrowser.moveTabTo.toString().replace(/{/, "$& if (aTab == this.mCurrentTab) this.__uc_addedTabs = 0;"));

eval("nsBrowserAccess.prototype.openURI = " + nsBrowserAccess.prototype.openURI.toString().replace(/(loadOneTab\()"about:blank"/, '$1"data:text/html,"'));

gBrowser.mTabContainer.addEventListener("select", function() { gBrowser.__uc_addedTabs = 0; }, false);
})();


This was working perfectly well till yesterday. I downloaded the hourly after the landing of "New Left Pane for Places Organizer"; I believe a few other bugs were also landed between the previous nightly and this particular hourly.

On this hourly, if the code mentioned above is included in userChrome.js, I am not able to close tabs.

I see the following error in error console:

Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIWebProgress.removeProgressListener]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://browser/content/tabbrowser.xml :: removeTab :: line 1393"  data: no]

Not sure what went wrong.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
(Reporter)

Comment 1

10 years ago
Blocking Bug #387746. Am not sure if the regression is due to that bug, but seems most likely.
Blocks: 387746
(Reporter)

Comment 2

10 years ago
Just looked for the regression range. Looks like it is Bug #398609 and build is: 20071119_0916_firefox-3.0b2pre.en-US.win32
Blocks: 398609
No longer blocks: 387746
Flags: blocking-firefox3?

Comment 3

10 years ago
Could you check on which line of the code the exception is thrown? 
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Reporter)

Comment 4

10 years ago
(In reply to comment #3)
> Could you check on which line of the code the exception is thrown? 
> 

I looked into tabbrowser.xml and given that the error is occuring near line 1392/1393 (from Error Console), the problems seems to be somewhere in the follwing code (this code is part of the removeTab method):

            // Remove the tab's filter and progress listener.
            const filter = this.mTabFilters[index];
            var oldBrowser = this.getBrowserAtIndex(index);
            oldBrowser.webProgress.removeProgressListener(filter);
            filter.removeProgressListener(this.mTabListeners[index]);
            this.mTabFilters.splice(index, 1);
            this.mTabListeners.splice(index, 1);
(Reporter)

Comment 5

10 years ago
Now this problem occurs intermittently (starting 11/20 nightly). Will watch for a few builds and report back if the problem persists.
(Reporter)

Comment 6

10 years ago
Since Build 20071119_0916_firefox-3.0b2pre.en-US.win32 (when Bug #398609 was checked in), another thing that broke is opening of links from external applications. But there are a lot of interdependencies as follows:

- In 1119_0916 build, if the code mentioned above is removed from userChrome.js, then links from external applications open correctly.
- As of today, 'Tab History' extension got busted (https://addons.mozilla.org/en-US/firefox/addon/1859). If you disable the Tab History extension, links open fine again.

Am not sure what are the dependencies here, but all of them basically seem to have originated from Bug #398609. In addition, today's thread shows that a lot of other extensions have also been busted. (http://forums.mozillazine.org/viewtopic.php?t=605117). Its possible that it could have been caused due to some additional check-ins, but surely a lot of them originated on 11/19.

Comment 7

10 years ago
I suspect that the regressions are covered by bug 404499 where the patch is waiting for a review/approval.

Updated

10 years ago
Depends on: 404499

Updated

10 years ago
Keywords: regression
OS: Windows Vista → All
Hardware: PC → All
Summary: Regression: Unable to Close Tabs when "Open Tabs Relative" code is active in userChrome.js → Unable to Close Tabs when "Open Tabs Relative" code is active in userChrome.js
Version: unspecified → Trunk
Igor: do you think this blocks? I'm not compelled by the specific use case reflected in comment 0, but if it's implying that there's a deeper problem in JS, we should probably block on it.

Comment 9

10 years ago
(In reply to comment #8)
> Igor: do you think this blocks? 

The bug 404499 definitely should block. If addressing that would not help this one, I will consider blocking this one.
--> Core::Javascript Engine
Assignee: nobody → general
Component: Tabbed Browser → JavaScript Engine
Flags: blocking-firefox3?
Product: Firefox → Core
QA Contact: tabbed.browser → general
transferring nomination; possibly to be fixed by bug 404499, but I think we should block on it just in case it isn't.
Flags: blocking1.9?
(Reporter)

Comment 12

10 years ago
Post Bug #404499 landing, in the latest hourly, I *think* most of the problems I was facing with extensions and Javascript have been resolved. Keeping my fingers crossed. If things go well for a day or two, we can close this Bug.
K, minusing for now, renom if it isn't fixed.
Flags: blocking1.9? → blocking1.9-
Er, whoops, that was wrong of me. PLUSsing for now, please mark fixed if it turns out to be fixed. :)
Flags: blocking1.9- → blocking1.9+
(Reporter)

Comment 15

10 years ago
Marking Fixed for now.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED

Updated

10 years ago
Resolution: FIXED → DUPLICATE
Duplicate of bug: 404499
You need to log in before you can comment on or make changes to this bug.