Page action API can crash the browser

RESOLVED WORKSFORME

Status

()

Firefox for Android
Add-on Manager
RESOLVED WORKSFORME
3 years ago
2 years ago

People

(Reporter: Margaret, Assigned: Margaret)

Tracking

35 Branch
Points:
---

Firefox Tracking Flags

(fennec+)

Details

(crash signature)

(Assignee)

Description

3 years ago
https://crash-stats.mozilla.com/report/index/1fe338ed-aaea-4a72-823a-9479b2150928

java.lang.UnsupportedOperationException: Unsupported property type
	at org.mozilla.gecko.util.NativeJSObject.toBundle(Native Method)
	at org.mozilla.gecko.toolbar.PageActionLayout.handleMessage(PageActionLayout.java:86)
	at org.mozilla.gecko.EventDispatcher.dispatchEvent(EventDispatcher.java:223)
	at org.mozilla.gecko.GeckoAppShell.handleGeckoMessage(GeckoAppShell.java:2278)
	at org.mozilla.gecko.mozglue.GeckoLoader.nativeRun(Native Method)
	at org.mozilla.gecko.GeckoThread.run(GeckoThread.java:424)


Here's a snippet of the relevant add-on code:

function loadIntoWindow(win) {
  // Using data URIs as a workaround until bug 993698 is fixed.
  if (win.devicePixelRatio <= 1.5) {
    gPageActionIcon = ICON_HDPI;
  } else if (win.devicePixelRatio <= 2) {
    gPageActionIcon = ICON_XHDPI;
  } else {
    gPageActionIcon = ICON_XXHDPI;
  }

  // TODO: Only show the page action when a TV is present.
  gPageActionId = PageActions.add({
    icon: gPageActionIcon,
    title: Strings.GetStringFromName("pageaction.title"),
    clickCallback: () => chooseAction(win)
  });
}

function unloadFromWindow(win) {
  PageActions.remove(gPageActionId);
}

This happens when I try to uninstall the add-on, so I suspect something is going wrong with the remove method.
Assignee: nobody → margaret.leibovic
tracking-fennec: ? → 42+
(Assignee)

Comment 1

3 years ago
I wasn't able to reproduce this when I tried to write a patch after encountering this. I'll have to try harder to see if I can reproduce, but it makes me less worried about it (I don't see why this would need to track 42).
(Assignee)

Updated

3 years ago
tracking-fennec: 42+ → +
(Assignee)

Updated

2 years ago
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.