Closed
Bug 937769
Opened 11 years ago
Closed 11 years ago
JS Error: Error in invoking addEngine, no onError
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
Firefox 28
People
(Reporter: aaronmt, Assigned: liuche)
References
Details
Attachments
(1 file, 1 obsolete file)
2.98 KB,
patch
|
liuche
:
review+
|
Details | Diff | Splinter Review |
E/GeckoConsole(19787): [JavaScript Error: "Error invoking addEngine install callback: [Exception... "'JavaScript component does not have a method named: "onError"' when calling method: [nsISearchInstallCallback::onError]" nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)" location: "JS frame :: jar:jar:file:///data/app/org.mozilla.fennec-2.apk!/assets/omni.ja!/components/nsSearchService.js :: SRCH_SVC_addEngine/engine._installCallback :: line 3870" data: no]" {file: "jar:jar:file:///data/app/org.mozilla.fennec-2.apk!/assets/omni.ja!/components/nsSearchService.js" line: 3872}] I attmpted to add the BMO engine. Nothing happened. It failed.
Assignee | ||
Comment 1•11 years ago
|
||
Thanks for catching this, I somehow missed this part of the interface...This is a pretty quick little fix.
Assignee: nobody → liuche
Assignee | ||
Comment 2•11 years ago
|
||
Didn't fully implement the nsSearchInstallCallback interface originally. Added some strings. Ian, any thoughts on the strings? For an unknown error: "Couldn't add <engine-name> as a search engine" Duplicate engine already exists: "<engine-name> is already one of your search engines"
Attachment #831093 -
Flags: review?(lucasr.at.mozilla)
Flags: needinfo?(ibarlow)
Assignee | ||
Updated•11 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•11 years ago
|
||
I wasn't able to reproduce an "unknown error," but it's possible to create a "duplicate engine" error by opening copies of the same page (that supports opensearch) in two tabs, and then trying to add the engine for each tab. Relatedly: bug 937870 always displays a "duplicate engines" prompt, which can be observed in the above STR.
Comment 4•11 years ago
|
||
Comment on attachment 831093 [details] [diff] [review] Patch: implement onError in nsSearchInstallCallback Review of attachment 831093 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. Suggested changes are optional. ::: mobile/android/chrome/content/browser.js @@ +6808,5 @@ > + NativeWindow.toast.show(Strings.browser.formatStringFromName("alertSearchEngineErrorToast", [engine.title], 1), "long"); > + break; > + case 2: > + // Engine is a duplicate. > + NativeWindow.toast.show(Strings.browser.formatStringFromName("alertSearchEngineDuplicateToast", [engine.title], 1), "long"); Maybe something like this would be cleaner? let errorMessage; if (aCode == 2) { // Engine is a duplicate. errorMessage = "alertSearchEngineDuplicateToast"; } else { // Unknown failure. Display general error message. errorMessage = "alertSearchEngineErrorToast"; } if (errorMessage) { NativeWindow.toast.show(Strings.browser.formatStringFromName(errorMessage, [engine.title], 1), "long"); } Not a big deal though. Up to you. In any case, maybe we should always an error message if onError is called?
Attachment #831093 -
Flags: review?(lucasr.at.mozilla) → review+
Comment 5•11 years ago
|
||
(In reply to Chenxia Liu [:liuche] from comment #2) > Created attachment 831093 [details] [diff] [review] > Patch: implement onError in nsSearchInstallCallback > > Didn't fully implement the nsSearchInstallCallback interface originally. > Added some strings. > > Ian, any thoughts on the strings? > For an unknown error: "Couldn't add <engine-name> as a search engine" > Duplicate engine already exists: "<engine-name> is already one of your > search engines" that sounds good to me, Chenxia
Flags: needinfo?(ibarlow)
Assignee | ||
Comment 6•11 years ago
|
||
Carrying over r+. Will land once trees are open again...
Attachment #831093 -
Attachment is obsolete: true
Attachment #831808 -
Flags: review+
Assignee | ||
Comment 7•11 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/02cc61730c27
https://hg.mozilla.org/mozilla-central/rev/02cc61730c27
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 28
Comment 9•11 years ago
|
||
Verified as fixed in build: Nightly 28.0a1 (2013-11-19) Device: Asus Transformer Tab (Android 4.0.3) Note: The BMO search engine is successfully added without any errors in the logcat.
Status: RESOLVED → VERIFIED
Updated•3 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•