Closed
Bug 216900
Opened 22 years ago
Closed 22 years ago
Tabbrowser cannot have more web progress listeners in nonmulti-tabbed mode
Categories
(SeaMonkey :: Tabbed Browser, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 238696
People
(Reporter: bugzilla, Assigned: jag+mozilla)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; cs-CZ; rv:1.4) Gecko/20030624
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; cs-CZ; rv:1.4) Gecko/20030624
I am writing add-on which add web progress listener to the browser window.
But there is a bug in the tabrowser. You cannot register more then one web
progress listeners for tabbrowser wich was not switched to the multitabbed mode.
When the browser is not in multi-tabbed mode (i.e. is set
"browser.tabs.autoHide" and you open new browser window with only one tab)
during short time appears a big problem, because the main proggress listener of
the Mozilla browser after some second stops working (and so browser GUI stops to
working properly).
I think I have found the problem. Look in tabrowser.xml:
<method name="addProgressListener">
...
if (!this.mTabbedMode) {
// hook a filter up to our first browser
const filter =
Components.classes["@mozilla.org/appshell/component/browser-status-filter;1"]
.createInstance(Components.interfaces.nsIWebProgress);
this.mTabFilters[0] = filter;
this.mCurrentBrowser.webProgress.addProgressListener(filter,
Components.interfaces.nsIWebProgress.NOTIFY_ALL);
// Directly hook the listener up to the filter for better performance
this.mTabFilters[0].addProgressListener(aListener, aMask);
}
...
</method>
If the tabrowser is not in tabbed mode and you call method addProgressListener
more times, the previous listener (filter) is dereferenced because in
"this.mTabFilters[0] = filter" is the old replaced and during time destroyed by
garbage collector.
I am using the trick and call in my add-on every time:
var browser = getBrowser();
if (!browser.mTabbedMode)
browser.enterTabbedMode();
because in tabbed mode everything works.
I doesn't know how is nontabbedmode usefull - there is enterTabbedMode() but no
leaveTabbedMode() ;-)
Maybe the enterTabbedMode() should be called by default in the browser window
(user cannot see any difference).
Or instead of "this.mTabFilters[0] = filter" use this.mTabFilters.push(filter).
Tested with M1.4 and nightly build 1.5b (2003081904)
Reproducible: Always
Steps to Reproduce:
Updated•22 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 1•22 years ago
|
||
resolving this as a duplicate of bug 238696 since I posted some patches there
*** This bug has been marked as a duplicate of 238696 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Updated•17 years ago
|
Product: Core → SeaMonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•