The default bug view has changed. See this FAQ.

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

RESOLVED FIXED in Firefox 6

Status

()

Firefox
Tabbed Browser
RESOLVED FIXED
7 years ago
2 years ago

People

(Reporter: Alice0775 White, Assigned: dao)

Tracking

Trunk
Firefox 6
All
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
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
(Assignee)

Updated

7 years ago
Component: Tabbed Browser → Shell Integration
QA Contact: tabbed.browser → shell.integration
(Assignee)

Updated

7 years ago
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.
(Assignee)

Comment 2

7 years ago
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)

Updated

7 years ago
Assignee: nobody → dao
(Assignee)

Comment 3

7 years ago
Created attachment 449330 [details] [diff] [review]
open the new tab before dispatching TabClose

the good news is that this doesn't regress bug 486280
Attachment #449330 - Flags: review?(gavin.sharp)

Comment 4

7 years ago
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.

Comment 5

7 years ago
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.

Comment 6

7 years ago
Another easy way to replicate is to install this add-on:

http://speeddial.uworks.net/

Running Firefox 3.6.8 on Win7 x64.

Comment 7

6 years ago
This still happens in Win7 in latest 4.0b8pre nightlies. x64 too, so changing platform to 'All'
Hardware: x86 → All

Updated

6 years ago
Duplicate of this bug: 584296

Comment 9

6 years ago
Confirm, this is very annoying
Error: preview is undefined
Source: resource://gre/modules/WindowsPreviewPerTab.jsm
Line: 380
some times impossible to check error's
(Assignee)

Updated

6 years ago
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

Comment 10

6 years ago
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.

Comment 11

6 years ago
in Firefox rc1-candidates buld1 bug still exist.

Comment 12

6 years ago
ad comment #11
Confirmed.

Comment 13

6 years ago
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

Comment 14

6 years ago
More of that, bug still exist if firefox 5 and firefox 6

Comment 15

6 years ago
the same, bug still exist in firefox 4.0.1

Comment 16

6 years ago
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+
(Assignee)

Comment 18

6 years ago
http://hg.mozilla.org/mozilla-central/rev/fde29e9e42ac
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 6

Comment 19

6 years ago
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.

Comment 20

6 years ago
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"

Comment 21

6 years ago
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. ;-)
(Assignee)

Updated

6 years ago
Duplicate of this bug: 659079

Comment 23

6 years ago
(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.

Comment 24

5 years ago
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.

Comment 25

5 years ago
(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.