Closed Bug 563337 Opened 10 years ago Closed 9 years ago

"Error: preview is undefined" and "this.preview is undefined" when closing the last tab with browser.tabs.closeWindowWithLastTab = false

Categories

(Firefox :: Tabbed Browser, defect)

All
Windows 7
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 6

People

(Reporter: alice0775, Assigned: dao)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; WOW64; en-US; rv:1.9.3a5pre) Gecko/20100503 Minefield/3.7a5pre ID:20100503040502
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; WOW64; en-US; rv:1.9.3a5pre) Gecko/20100503 Minefield/3.7a5pre ID:20100503040502

Error: preview is undefined  and Error: this.preview is undefined when last tab is closed under condition of browser.tabs.closeWindowWithLastTab is false

Error: this.preview is undefined
Source File: file:///D:/firefox-3.7a1pre.en-US.win32/modules/WindowsPreviewPerTab.jsm
Line: 269
Error: preview is undefined
Source File: file:///D:/firefox-3.7a1pre.en-US.win32/modules/WindowsPreviewPerTab.jsm
Line: 352

Reproducible: Always

Steps to Reproduce:
1. Start Minefield with "NEW profile".
2. Set browser.tabs.closeWindowWithLastTab to false
3. Close tabs

Actual Results:
 Error: preview is undefined  and Error: this.preview is undefined when last tab is closed

Expected Results:
 No error
Component: Tabbed Browser → Shell Integration
QA Contact: tabbed.browser → shell.integration
Blocks: 474056
From what I can tell, the source of the problem is in tabbrowser.xml's _endRemoveTab - it adds a new tab at index 1 and then later fudges it to index 0. Unfortunately the index is stored by the newTab handler in WindowsPreviewPerTab.jsm at the time of creation (it's used an an index) so things just fall apart.

Dao, would it be possible to create the new tab at index 0 (it's final resting place)? I think this would fix the problem as the TabClose event for aTab has already been dispatched by this point.
Investigating. Creating the tab with _tPos=0 would be possible, but it might confuse other users of that property, as there would be two tabs with that value.
Component: Shell Integration → Tabbed Browser
QA Contact: shell.integration → tabbed.browser
Assignee: nobody → dao
the good news is that this doesn't regress bug 486280
Attachment #449330 - Flags: review?(gavin.sharp)
This should maybe be tackled a bit soon-ish.

Current 4.0b2pre Minefield builds have the Error Console all cluttered up with those "preview is undefined" messages - still.
I'm not sure if this is the exact same bug but I didn't see this bug-report here until a couple of days ago... I created this one about a week ago.  If It's the same one then somebody may want to clean up my mistake :) and combine them??

https://bugzilla.mozilla.org/show_bug.cgi?id=584296

Note the link to the image of my Error Console.
Another easy way to replicate is to install this add-on:

http://speeddial.uworks.net/

Running Firefox 3.6.8 on Win7 x64.
This still happens in Win7 in latest 4.0b8pre nightlies. x64 too, so changing platform to 'All'
Hardware: x86 → All
Duplicate of this bug: 584296
Confirm, this is very annoying
Error: preview is undefined
Source: resource://gre/modules/WindowsPreviewPerTab.jsm
Line: 380
some times impossible to check error's
Summary: Error: preview is undefined and Error: this.preview is undefined when last tab is closed under condition of browser.tabs.closeWindowWithLastTab is false → "Error: preview is undefined" and "this.preview is undefined" when closing the last tab with browser.tabs.closeWindowWithLastTab = false
This error ends up being reported thousands of times per minute, and appears to be causing 10-15% CPU usage all by itself.

This really needs fixing.
in Firefox rc1-candidates buld1 bug still exist.
ad comment #11
Confirmed.
This bug *still* exists in the final release of 4.0:

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0 ID:20110318052756
More of that, bug still exist if firefox 5 and firefox 6
the same, bug still exist in firefox 4.0.1
I would like to this fixed a bug as soon as possible, I'm tired of manually modify the same file with each update :)
Comment on attachment 449330 [details] [diff] [review]
open the new tab before dispatching TabClose

We should probably add some tests that cover the ordering of TabSelect/TabOpen/TabClose events and the rest of the tabbrowser state when they're fired.

(this needs to be unbitrotten for tab opening animations, but that's trivial)
Attachment #449330 - Flags: review?(gavin.sharp) → review+
http://hg.mozilla.org/mozilla-central/rev/fde29e9e42ac
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 6
Really?  This is SUCH a painfully large change (moving two lines and adding an else) that it has to skip a major release?  5.0 is barely alpha right now.
Jay, Mozilla like to land changes to central first, in order to test them and make sure they don't cause any regressions or other bustages. 
Also your comment is rather rude, a better way to ask would have been 
"Hey, is this likely to get fixed for fx5 once it's been tested on trunk?  It's quite a small change and is a big improvement for users of the error console"
Hey, is this likely to get fixed for Firefox 4.x or 5 once it's been tested on trunk?  It's quite a small change and is a big improvement for users of the error console. ;-)
Duplicate of this bug: 659079
(In reply to comment #20)
> Also your comment is rather rude, a better way to ask would have been 
> "Hey, is this likely to get fixed for fx5 once it's been tested on trunk? 

Rude? It's the naked truth. I couldn't have worded it better.
Hi all -- I have Firefox 8 and my error console is still getting constantly filled with "Error: preview is undefined Source File: resource:///modules/WindowsPreviewPerTab.jsm Line: 380" -- I absolutely don't mind opening a new but report, but I wanted to check with y'all here first, so I don't open a new thing just to have it marked as a duplicate.  Apologies if this isn't the right way to go about it (just let me know what I should do instead, if that's the case).

So, I'm on Windows 7, Firefox 8, and my error console is filled with the error (details copied/pasted in this comment) -- and if I "clear" the error list, go back to any Firefox window (other than the Error Console), and then look at the error console again -- even without doing *anything* other than switching windows -- the error list is already full of the error message all over again.

Is anyone else still having this issue / did the problem go away for folks after Firefox 6?

Thanks in advance for any help you can offer, and again, just let me know if I should post this as a new thing.
(In reply to Alison from comment #24)
> Hi all -- I have Firefox 8 and my error console is still getting constantly
> filled with "Error: preview is undefined Source File:
> resource:///modules/WindowsPreviewPerTab.jsm Line: 380" -- I absolutely
> don't mind opening a new but report, but I wanted to check with y'all here
> first, so I don't open a new thing just to have it marked as a duplicate. 
> Apologies if this isn't the right way to go about it (just let me know what
> I should do instead, if that's the case).
> 
> So, I'm on Windows 7, Firefox 8, and my error console is filled with the
> error (details copied/pasted in this comment) -- and if I "clear" the error
> list, go back to any Firefox window (other than the Error Console), and then
> look at the error console again -- even without doing *anything* other than
> switching windows -- the error list is already full of the error message all
> over again.
> 
> Is anyone else still having this issue / did the problem go away for folks
> after Firefox 6?
> 
> Thanks in advance for any help you can offer, and again, just let me know if
> I should post this as a new thing.


Alison

This bug has not been active for some time.... in my Firefox (now version 8)...

As a test, you might want to create a new profile and do some browsing with it... then check you error console.
http://kb.mozillazine.org/Creating_a_new_Firefox_profile_on_Windows
You need to log in before you can comment on or make changes to this bug.