Closed Bug 1038003 Opened 8 years ago Closed 5 years ago

jpm/cfx optionsURL placeholder inline options not shown in fennec

Categories

(Add-on SDK Graveyard :: General, defect, P2)

x86
Android
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: anaran, Unassigned)

References

()

Details

Attachments

(2 files)

I have not been able to track it down exactly, but something around these changes in https://github.com/mozilla/addon-sdk/pull/1368
(see https://github.com/mozilla/addon-sdk/pull/1368#issuecomment-48849440)
seems to have broken inline option support in Firefox for Android.

I am using nightly fennec and build my addon, https://github.com/anaran/JotFirefox/tree/master/Jot, using

cmd /c "%HOME%/tmp/mozilla/addon-sdk/bin/activate && cfx xpi -v --force-mobile -b c:/programme/nightly/firefox.exe"

Inline options work fine in nightly firefox on Windows XPP, but not in latest nightly fennec installed under android 4.3.
Apart from the options not showing the extension basically works in fennec too.

A package built with jpm xpi -v -b c:/programme/nightly/firefox.exe does not install in fennec.
A toast message says it is not compatible.

The package built with jpm does NOT show an [Options] button in Windows XPP either and self.data.uri does not work either.
The inline options show and work fine on android when building against sdk 1.16 using instructions in
https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Installation#Building_Extension_for_AMO
Summary: inline options not shown in fennec → cfx: inline options not shown in fennec; jpm: not on windows xpp either
jpm built extension does not show inline options on windows xpp when built will latest official SDK release 1.16 either.

This should push addon-sdk lib changes out of the picture, if I understand this right.

(addon-sdk-1.16)AichnerAd@Kuckuck:~/tmp/mozilla/JotFirefox/Jot$ cmd /c "%HOME%/tmp/mozilla/addon-sdk-1.16/bin/activate && jpm xpi -v -b c:/programme/nightly/firefox.exe"
Welcome to the Add-on SDK. For the docs, visit https://addons.mozilla.org/en-US/developers/docs/sdk/latest/
JPM info verbose set to true
JPM info binary set to c:/programme/nightly/firefox.exe
JPM info Running undefined on Jot
JPM info Creating XPI at  C:\Users\AichnerAd\tmp\mozilla\JotFirefox\Jot\jot.xpi
JPM info Successfully created xpi at C:\Users\AichnerAd\tmp\mozilla\JotFirefox\Jot\jot.xpi
(addon-sdk-1.16)AichnerAd@Kuckuck:~/tmp/mozilla/JotFirefox/Jot$
See also
Bug 1038437: AMO Add-on Compatibility Checker finds jpm-built extension compatible with fennec, incorrectly
Priority: -- → P2
...but that doesn't mean I don't care
I split off the jpm on Windows part of this to bug 1052803 so it can be tracked separately.
Summary: cfx: inline options not shown in fennec; jpm: not on windows xpp either → cfx: inline options not shown in fennec
Summary: cfx: inline options not shown in fennec → jpm: inline options not shown in fennec
As of jpm git master (jpm -V says 0.0.19) this still does not work in Android (4.3) while it works fine on windows xp.

validate function takes same paths on android as in windows.

On android, however, neither getAddonByID callback nor onAddonOptionsDisplayed gets called.

from
sdk/preferences/native-options.js

  // allow the use of custom options.xul
  AddonManager.getAddonByID(id, (addon) => {
    on('addon-options-displayed', onAddonOptionsDisplayed, true);
    enabled.resolve({ id: id });
  });

  function onAddonOptionsDisplayed({ subject: doc, data }) {
sdk/addon/runner.js catch is entered on android,
but I can't determine or find the value of error logged.

    // native-options does stuff directly with preferences key from package.json
    if (preferences && preferences.length > 0) {
      try {
        require('../preferences/native-options').
          enable({ preferences: preferences, id: id }).
          catch(console.exception);
      }
      catch (error) {
->      console.exception(error);
      }
Summary: jpm: inline options not shown in fennec → jpm/cfx optionsURL placeholder inline options not shown in fennec
turns out the same problem happens when I build with cfx using addon-sdk git sources, still works fine when using addon-sdk-1.17.

Margaret's patch to Fennec's aboutAddons.js improves the situation by sending notifications for placeholder optionsURL as well. Margaret, I think aboutAddons.js should not set optionsURL = "" for placeholder options. Can you take another look, perhaps provide a new fennec.apk.

Another small patch initially suggested by Tomislav against addon-sdk native-options.js makes these placeholder options appear in the AOM in Fennec. I'll send a pull request for that.

One problem remains (or two):

preference types control and menulist (probably radio too) show up as empty UI elements, even though native-options.js sets their labels. They cannot be interacted with in Fennec because of that.
I will add a screenshot for that.
It's these preferences, also to be found at
https://github.com/anaran/JotFirefox/blob/master/Jot/package.json

    {
      "description": "Please search list of existing issues before you report bugs and suggest features.",
      "hidden": false,
      "label": "Report Bugs, Suggest Features",
      "name": "REPORT_ISSUE",
      "title": "Report Bugs, Suggest Features",
      "type": "control"
    },

    {
      "description": "Controls the amount of logging to the browser console by level, from all to errors only to nothing at all. Increase the log level when investigating problems.",
      "name": "sdk.console.logLevel",
      "type": "menulist",
      "title": "Console Logging Level",
      "value": "off",
      "options": [{
        "value": "all",
        "label": "all"
      }, {
        "value": "debug",
        "label": "debug"
      }, {
        "value": "info",
        "label": "info"
      }, {
        "value": "warn",
        "label": "warn"
      }, {
        "value": "error",
        "label": "error"
      }, {
        "value": "off",
        "label": "off"
      }]
    },
Depends on: 1106415
Status: UNCONFIRMED → NEW
Ever confirmed: true
Depends on: 1110502
https://bugzilla.mozilla.org/show_bug.cgi?id=1399562
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.