Last Comment Bug 320370 - Search Engines not added - window.sidebar.addSearchEngine is not a function
: Search Engines not added - window.sidebar.addSearchEngine is not a function
Status: RESOLVED FIXED
: fixed-seamonkey1.1a, fixed1.8, regression
Product: SeaMonkey
Classification: Client Software
Component: Sidebar (show other bugs)
: Trunk
: x86 Windows XP
: -- major (vote)
: ---
Assigned To: Andrew Schultz
:
:
Mentors:
http://mycroft.mozdev.org/quick/dicti...
Depends on: 315346
Blocks: 310637 319300
  Show dependency treegraph
 
Reported: 2005-12-15 04:29 PST by Mycroft Project (CC)
Modified: 2008-04-23 16:43 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch (1.10 KB, patch)
2005-12-17 10:33 PST, Andrew Schultz
no flags Details | Diff | Splinter Review
patch for 1.8 branch (1.08 KB, patch)
2005-12-18 12:32 PST, Andrew Schultz
kairo: approval‑seamonkey1.0+
Details | Diff | Splinter Review

Description Mycroft Project (CC) 2005-12-15 04:29:49 PST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8) Gecko/20051111 Firefox/1.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051214

See http://bugzilla.mozdev.org/show_bug.cgi?id=12479
This build doesn't seem to allow addSearchEngine()
IRC discussion suggests Components.interfaces.nsISidebar doesn't exist. 

Reproducible: Always

Steps to Reproduce:
1. Try to install a search engine from the above page with this build
2. Get JS error
3. Er....



Expected Results:  
Install search engine
Comment 1 Robert Kaiser 2005-12-15 04:39:01 PST
additional info from IRC:

<biesi> Error: window.sidebar.addSearchEngine is not a function
<biesi> Source File: javascript:window.sidebar.addSearchEngine()
<biesi> Line: 1
<biesi> hmm
<biesi> that's odd
<ccaygill> it is... it always used to be a function
<biesi> window.sidebar doesn't seem to have any sidebar functions


OK, at least it WFM on my recent Linux 1.0b branch build, so it might be trunk-only. I'd like to hear from Windows installer users as well before getting it off the Beta radar though.
Comment 2 moz 2005-12-15 07:14:48 PST
For trying, I've installed now  a search engine and at least it works in Mozilla 1.7.11 under Windows (*). So the plug-in it's not to blame.

Tomorrow I can try it with Seamonkey in another computer where I have it installed.

(*)  User-Agent:  Mozilla/5.0 (Windows; U; Windows NT 5.0; es-ES; rv:1.7.11) Gecko/20050728  
Comment 3 Andrew Schultz 2005-12-15 07:50:42 PST
worksforme with linux seamonkey trunk 2005121302 and 1.0 branch build 20051213.  I try to install the Yahoo Groups search plugin http://mycroft.mozdev.org/quick/yahoo.html and it brought up the dialog in both builds.
manually doing the tests for typeof window.sidebar and typeof window.sidebar.addSearchEngine was successful
Comment 4 RenegadeX 2005-12-15 11:48:19 PST
I downloaded SeaMonkey 1.5a 20051214 build yesterday and then tried to install some Mycroft search engine plugins. After clicking on a search engine pluign, I was surprised to see a dialog box pop up informing that:

"You need a Mozilla based browser to install a search plugin".
(!!)

My user agent string:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0rc2) Gecko/20020512 Netscape/7.0b1

I tried to work around the problem by spoofing my User Agent, but no go.

Checked the javascript console for errors, and the error I get is *not* the same as already posted here.

Error: [JavaScript Error: "[Exception... "'Permission denied to get property XULElement.accessKey' when calling method: [nsIDOMXULLabelElement::accessKey]"  nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)"  location: "JS frame :: http://mycroft.mozdev.org/default.js :: addEngine :: line 17"  data: no]" {file: "http://mycroft.mozdev.org/default.js" line: 17}]
Source File: http://mycroft.mozdev.org/default.js
Line: 17

I filed a Bug at Mycroft, but they took a look at things and blame this Bug (320370). Hopefully the info I provided will add some new light on the source of  the issue.
Comment 5 Andrew Schultz 2005-12-15 12:46:13 PST
the exception you see originates from the javascript alert(), rather than from the search plugin failure part.

My user agent string:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0rc2) Gecko/20020512
Netscape/7.0b1

That is not SeaMonkey 1.5a 20051214... it's not even Mozilla (although I would still expect it to work).  Are you actually running SeaMonkey and spoofing Netscape?
Comment 6 Christian :Biesinger (don't email me, ping me on IRC) 2005-12-15 14:10:11 PST
guys, this is not done with a useragent check. this is the check that determines whether sidebars can be added:
  if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {

see http://mycroft.mozdev.org/default.js
Comment 7 RenegadeX 2005-12-15 20:49:46 PST
> That is not SeaMonkey 1.5a 20051214... it's not even Mozilla (although I would
> still expect it to work).  Are you actually running SeaMonkey and spoofing
> Netscape?

Sorry, not sure what happened there - that was not the correct string. Correct is:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051214 MultiZilla/1.8.1.0p SeaMonkey/1.5a 

As Christian pointed out however, user agent is apparently irrelevant.
I'm just curious as to at what point this bug was introduced..
Comment 8 Andrew Schultz 2005-12-16 00:22:36 PST
Can you try a clean profile and/or an install without extensions?
Comment 9 moz 2005-12-16 01:12:15 PST
I tried it and WFM (Works For Me(*)) in the latest nightly build under windows:

Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20051215 SeaMonkey/1.5a

Also I tried it in SeaMonkey 1.0a under windows and it worked, too

Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b4) Gecko/20050910 SeaMonkey/1.0a

(*) I can add the search engine and later make it look for the word I want to search
Comment 10 zug_treno 2005-12-16 03:46:10 PST
Also WFM with SeaMonkey 1.5a/20051213, -14 and -15, SeaMonkey 1.0a worked a few days ago (see bug 319782).
Comment 11 Christian :Biesinger (don't email me, ping me on IRC) 2005-12-16 04:20:23 PST
how did the people using trunk for which this works install mozilla? installer or zip?
Comment 12 moz 2005-12-16 04:27:29 PST
> how did the people using trunk for which this works install mozilla? installer
or zip?

I renamed the old c:\program files\Mozilla.org\Seamonkey folder (installed with the installer of Seamonkey 1.0a), and I used the zip file to put its content into c:\program files\Mozilla.org\Seamonkey
Comment 13 Eyal Rozenberg 2005-12-16 08:03:46 PST
Does _not_ WFM with 2005-12-15 on XP. I get the same exception as in comment 4.
Comment 14 Andrew Schultz 2005-12-16 08:09:43 PST
Eyal: did you use an installer build?  Can you try a zip build?
Comment 15 RenegadeX 2005-12-16 11:53:52 PST
(In reply to comment #14)
> Eyal: did you use an installer build?  Can you try a zip build?

Ok..
The original install that I noticed the issue was a Win32 .exe installation.

I just downloaded the EXE and ZIP Win32 versions found in this directory:
http://ftp.mozilla.org/pub/mozilla.org/seamonkey/nightly/latest-trunk/

Both show the same headers and Build ID (in the title bar):
Build ID: 2005121509
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051215 SeaMonkey/1.5a

But while the EXE installation produces the 'You need to install a Mozilla based browser' error on Mycroft, the ZIP *does not* - the zip install allows search engine plugin installation (to the sidebar).
Comment 16 Eyal Rozenberg 2005-12-16 11:58:31 PST
(In reply to comment #14)
> Eyal: did you use an installer build? 
Yes
> Can you try a zip build?

It doesn't work if I unzip over the installer build. Maybe a 'clean' zip build would work. comment 15 sounds about right.
Comment 17 RenegadeX 2005-12-16 15:22:13 PST
Ok, I narrowed it down..

(Win32 EXE installer files located in the following directories @ http://ftp.mozilla.org/pub/mozilla.org/seamonkey/nightly/) :

2005-12-05-10-trunk -- OK
2005-12-06-11-trunk -- BROKEN (exhibits the mycroft 'You need a Mozilla browser..' error).

So the file in the 12-05-10-trunk directory was the last working exe installer to date. The Build ID of this file (as seen in the title bar) says: 2005120508, and the User Agent string from 'about SeaMonkey' says:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051205 SeaMonkey/1.5a

The file in the 2005-12-06-11-trunk directory shows a Build ID of 2005120609 and has the following User Agent string:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051206 SeaMonkey/1.5a
Comment 18 Andrew Schultz 2005-12-16 18:43:32 PST
thanks, RenegadeX.
Comment 19 Andrew Schultz 2005-12-17 10:33:22 PST
Created attachment 206189 [details] [diff] [review]
patch

this seems to be the only place sidebar is missing.  But a lot is missing, so I don't know we don't have reports of them being broken.  I guess nobody is using them from web pages.

This is untested, so it'd be nice if someone could test it out.
Comment 20 Robert Kaiser 2005-12-17 12:32:32 PST
Apparently it's not happening on branch, so clearing branch blocker request.
Comment 21 Christian :Biesinger (don't email me, ping me on IRC) 2005-12-18 12:22:02 PST
r=biesi if that helps
Comment 22 neil@parkwaycc.co.uk 2005-12-18 12:29:19 PST
Comment on attachment 206189 [details] [diff] [review]
patch

Sorry, installer is beyond my understanding.
Comment 23 Andrew Schultz 2005-12-18 12:32:15 PST
Created attachment 206258 [details] [diff] [review]
patch for 1.8 branch

trunk patch is in.  If that fixes it (along with canvas, etc), this is a branch patch with canvas, loadsave and svg.
Comment 24 Chris Thomas (CTho) [formerly cst@andrew.cmu.edu cst@yecc.com] 2005-12-18 13:54:31 PST
Comment on attachment 206258 [details] [diff] [review]
patch for 1.8 branch

I tested your patch and it works.

First a=me for post-freeze landing for 1.0b.  If you can't land it in time, you can carry my a= forward for 1.0 final.
Comment 25 Robert Kaiser 2005-12-18 14:05:38 PST
Comment on attachment 206258 [details] [diff] [review]
patch for 1.8 branch

a+ for post-freeze landing given it land before midnight PST.
Comment 26 Myk Melez [:myk] [@mykmelez] 2006-05-02 18:33:50 PDT
I landed the fix for bug 315346 on the 1.8 branch last night.  Does that impact this bug?
Comment 27 Andrew Schultz 2006-05-15 22:05:43 PDT
I landed the sidebar part of the original patch on the 1.8 branch

Note You need to log in before you can comment on or make changes to this bug.