Closed Bug 271022 Opened 20 years ago Closed 20 years ago

JavaScript Console Error: Opening Non-Sidebar Windows in the Sidebar ("searchBox has no properties")

Categories

(Firefox :: General, defect, P5)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: 73kbq4e02, Assigned: Gavin)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

If a window from an extension (or from a browser window that cannot be opened
from the sidebar without a specific extension) is opened in the sidebar, an
error will show up in the JavaScript Console.  I have noticed this both in my
current profile, and in a new one.  You may need to set
"javascript.options.showInConsole" to "true" in about:config for this to show up.

The error is as follows:

Error: searchBox has no properties
Source File: chrome://browser/content/browser.js
Line: 3330

And the line is:

searchBox.focus();

Reproducible: Always
Steps to Reproduce:
1. Install an extension which allows you to open up a window in the sidebar
(Download Manager Tweak, EMButtons, QuickNote, etc.).
2. If not set up to do so by default, set up the extension to open up a window
in the sidebar.
3. Open up the window affected by the extension, which should now open up in the
sidebar.
Actual Results:  
The error mentioned above is generated in the JavaScript Console.

Expected Results:  
The error mentioned above should not be generated at all.
Product: Browser → Seamonkey
Assignee: general → firefox
Product: Mozilla Application Suite → Firefox
QA Contact: general → firefox.general
This is really a minor issue. If extensions open themselves in the sidebar, the
sidebar code looks to focus the sidebar search box. It's a one line patch. I'll
attach one shortly.
Assignee: firefox → gavin.sharp
Status: UNCONFIRMED → NEW
Ever confirmed: true
Severity: minor → trivial
OS: Windows 2000 → All
Hardware: PC → All
Attachment #167812 - Flags: review?(mconnor)
Comment on attachment 167812 [details] [diff] [review]
Check if it exists before focusing

silly extensions :)
Attachment #167812 - Flags: review?(mconnor) → review+
Priority: -- → P5
Whiteboard: checkin-needed
Oops, sorry mlefevre.
Comment on attachment 167812 [details] [diff] [review]
Check if it exists before focusing

Checking in mozilla/browser/base/content/browser.js;
/cvsroot/mozilla/browser/base/content/browser.js,v  <--  browser.js
new revision: 1.361; previous revision: 1.360
done
Whiteboard: checkin-needed
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
I'm now using Mozilla Firefox 1.0.3, and it seems that this bug has returned. 
The error's still the same though - only the line number has changed (it's 3337
now, instead of 3330).
This bug wasn't checked into the branch where the 1.0.x releases are coming
from. The next release that will contain this fix is Firefox 1.1.
(Wow...THAT was a quick reply!)

Ah...My mistake, then - I didn't know that the fix for this was going to be in
1.1.  Thank you for clearing that up.
Comment on attachment 167812 [details] [diff] [review]
Check if it exists before focusing

seeking approval to land this trivial fix on 1.0 branch; without this patch the
event listener is never removed (and this function is called hundreds of times
for my sidebar).
Attachment #167812 - Flags: approval-aviary1.0.5?
Comment on attachment 167812 [details] [diff] [review]
Check if it exists before focusing

1.0.5 has already shipped; unsetting approval request.
Attachment #167812 - Flags: approval-aviary1.0.5?
*** Bug 250715 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: