HelperApps.getAppsForUri does not check for empty results and throws

RESOLVED FIXED in Firefox 26



5 years ago
5 years ago


(Reporter: mfinkle, Assigned: mfinkle)


Firefox 27

Firefox Tracking Flags

(firefox25 unaffected, firefox26 fixed, firefox27 fixed, fennec26+)



(1 attachment)

Created attachment 812258 [details] [diff] [review]
Check for valid return data

We assume that "Intent:GetHandlers" will always work, but GeckoView does not implement it, and may never implement it. This causes the JSON.parse to throw and breaks the initialization of many other parts of code. Effectively killing GeckoView.

In the long term, I want to split out code from browser.js into 3 code paths:
* Firefox (default)
* WebApp
* GeckoView

Some parts of the code won't be needed for WebApps and GeckoView, so let's not even add it.

In the meantime, this fixes the current problem. With this patch, GeckoView example apps work on everything but the Nexus 4 (bug 921792)
Attachment #812258 - Flags: review?(wjohnston)
Comment on attachment 812258 [details] [diff] [review]
Check for valid return data

Review of attachment 812258 [details] [diff] [review]:

::: mobile/android/chrome/content/HelperApps.js
@@ +60,5 @@
>        packageName: "",
>        className: ""
>      };
> +    let data = sendMessageToJava(msg);
> +    if (data) {

Early return instead?
Attachment #812258 - Flags: review?(wjohnston) → review+
(In reply to Wesley Johnston (:wesj) from comment #1)

> > +    let data = sendMessageToJava(msg);
> > +    if (data) {
> Early return instead?

Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 27
Duplicate of this bug: 920544
This fix needs uplift to Aurora.
status-firefox25: --- → unaffected
status-firefox26: --- → affected
status-firefox27: --- → fixed
tracking-firefox26: --- → ?
Err...wrong flag. Apologize for bugspam.
tracking-fennec: --- → ?
tracking-firefox26: ? → ---
Comment on attachment 812258 [details] [diff] [review]
Check for valid return data

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
User impact if declined: things like bug 920544
Testing completed (on m-c, etc.): landed and working OK
Risk to taking this patch (and alternatives if risky): low risk. we just check for empty data.
String or IDL/UUID changes made by this patch: none

When uplifting, please use the checked in patch since it is more simple:
Attachment #812258 - Flags: approval-mozilla-aurora?
Attachment #812258 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Assignee: nobody → mark.finkle
status-firefox26: affected → fixed
tracking-fennec: ? → 26+
You need to log in before you can comment on or make changes to this bug.