Closed Bug 1023661 Opened 10 years ago Closed 10 years ago

Add support for SeaMonkey

Categories

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

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: felix.shnir, Unassigned)

References

Details

Attachments

(4 files, 2 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36

Steps to reproduce:

It would be nice if we could use addon-sdk on other browsers like SeaMonkey.
hey Felix, patches welcome!

here is our contribution guide, or feel free to ask if you have any questions/need help with anything..

https://github.com/mozilla/addon-sdk/wiki/contribute
See Also: → 1071048
I believe one first step would be to run the unit tests https://github.com/mozilla/addon-sdk/tree/master/test on Seamonkey (and Thunderbird too I guess) to get a good overview of which parts of the APIs are supported and which ones are currently missing. Where can we find instructions to do that?
Flags: needinfo?(tomica+amo)
A SeaMonkey contributor has been running various SDK based addons through his converter:

http://forums.mozillazine.org/viewtopic.php?f=40&t=2822105&start=45

> QrCodeR Requires patch in context-menu.js, selection.js and panel.js.
> Awesome Screenshot Plus - success! Console says "TypeError: window.dcm_api is undefined" but works fine.
> Requires patch in panel.js.

After these smoke tests I think context-menu.js, selection.js and panel.js can be marked SeaMonkey compatible.
(In reply to Philip Chee from comment #3)
> After these smoke tests I think context-menu.js, selection.js and panel.js
> can be marked SeaMonkey compatible.

It seems that we don't have pull requests for that https://github.com/mozilla/addon-sdk/pulls?q=seamonkey+is%3Aopen. I can open one if that's the same as bug 1071048.
(In reply to Frédéric Wang (:fredw) from comment #4)
> (In reply to Philip Chee from comment #3)
> > After these smoke tests I think context-menu.js, selection.js and panel.js
> > can be marked SeaMonkey compatible.
> 
> It seems that we don't have pull requests for that
> https://github.com/mozilla/addon-sdk/pulls?q=seamonkey+is%3Aopen. I can open
> one if that's the same as bug 1071048.

Sorry haven't created a pull request yet because Github is a total PITA for me. If someone else wants to create a pull request along the same lines as bug 1071048 then please feel free to proceed.

p.s. Getting the unit tests running on SM or TB is still wanted.
(In reply to Philip Chee from comment #5)
> Sorry haven't created a pull request yet because Github is a total PITA for
> me. If someone else wants to create a pull request along the same lines as
> bug 1071048 then please feel free to proceed.
> 

OK, I can take care of that as I plan to do some manual tests for my own add-ons.

> p.s. Getting the unit tests running on SM or TB is still wanted.

Yes, that will be more reliable than manual testing...
(In reply to Frédéric Wang (:fredw) from comment #2)
> I believe one first step would be to run the unit tests
> https://github.com/mozilla/addon-sdk/tree/master/test on Seamonkey (and
> Thunderbird too I guess) to get a good overview of which parts of the APIs
> are supported and which ones are currently missing. Where can we find
> instructions to do that?

sorry, i wasn't around the jetpack project while non-fx app support was still maintained, so i have no idea about how any of that is supposed to work.

Erik, can you maybe provide some guidance?
Flags: needinfo?(tomica+amo) → needinfo?(evold)
OK, I tried some of my MathML add-on and it seems that https://addons.mozilla.org/firefox/addon/mathml-zoom/ and https://addons.mozilla.org/firefox/addon/mathjax-native-mathml/ are already supported, I just need to mention them in the manifest. Is there a way to do that with the cfx command line?

For https://addons.mozilla.org/firefox/addon/mathml-font-settings/, adding context-menu.js as suggested here will probably be enough.

For https://addons.mozilla.org/en-US/firefox/addon/mathml-copy/, I'll additionally need clipboard.js. I think this is merely a layer over the XPCOM clipboard & transferable services (no UI) so that should work on Seamonkey and Thunderbird too.
(In reply to Frédéric Wang (:fredw) from comment #8)
> OK, I tried some of my MathML add-on and it seems that
> https://addons.mozilla.org/firefox/addon/mathml-zoom/ and
> https://addons.mozilla.org/firefox/addon/mathjax-native-mathml/ are already
> supported, I just need to mention them in the manifest. Is there a way to do
> that with the cfx command line?

Ah, I just noticed https://github.com/mozilla/addon-sdk/pull/341. Anyway, I've submitted to AMO new versions of these two add-ons that are compatible with Seamonkey.

(In reply to Tomislav Jovanovic [:zombie] from comment #7)
> sorry, i wasn't around the jetpack project while non-fx app support was
> still maintained, so i have no idea about how any of that is supposed to
> work.
> 
> Erik, can you maybe provide some guidance?

Perhaps you can indicate how you run the tests on Firefox first, then we could guess how to adapt that for Seamonkey/Thunderbird...
(In reply to Frédéric Wang (:fredw) from comment #9)
> Perhaps you can indicate how you run the tests on Firefox first, then we
> could guess how to adapt that for Seamonkey/Thunderbird...

OK, as I understand

(addon-sdk):~ cfx testall -a thunderbird

is supposed to run all the test for Thunderbird (it does not seem to find my "Icedove" app, though). The "seamonkey" name is not accepted by the testall command.
Comment on attachment 8511501 [details] [review]
Pull request for clipboard, context-menu, panel and selection modules

why were the "stability": "unstable" changes made?
Flags: needinfo?(evold)
Attachment #8511501 - Flags: feedback-
Comment on attachment 8511501 [details] [review]
Pull request for clipboard, context-menu, panel and selection modules

well otherwise this is looks right, so f+!
Attachment #8511501 - Flags: feedback- → feedback+
(In reply to Erik Vold [:erikvold] (please needinfo? me) from comment #12)
> Comment on attachment 8511501 [details] [review]
> Pull request
> 
> why were the "stability": "unstable" changes made?

OK, I misread what was done in bug 1071048 and thought that unstable was needed because it's not tested at all on SeaMonkey.

Regarding the test execution, my understanding of the current situation is that

1) -a option of cfx relies on the mozrunner Python script which works on Firefox and Thunderbird but not SeaMonkey. Fennec has a special class to define the custom profile and stuff.

2) With the -b option of cfx, we can start arbitrary Gecko binary. However, when doing so with Thunderbird and SeaMonkey the Python script does not seem to be able to communicate with the Gecko app. The window opens, but the test execution seems to hang.
Comment on attachment 8511501 [details] [review]
Pull request for clipboard, context-menu, panel and selection modules

So I've been able to make my MathML-copy and MathML-fontsettings addon work in Seamonkey with these changes. Although, it's a pity we can not run the automated tests, at least this means that I tested clipboard.js & context-menu.js manually. I guess we can trust the other SeaMonkey contributor for the panel.js and selection.js testing.

For the record, I did

  cfx xpi -o --no-strip-xpi

to force the development version of the addon-sdk to be bundled & used in the add-on for testing. I still needed to modify install.rdf by hand, since bug 724276 was WONTFIXED for a different approach.
Attachment #8511501 - Flags: review?(evold)
Comment on attachment 8511501 [details] [review]
Pull request for clipboard, context-menu, panel and selection modules

Thanks!
Attachment #8511501 - Flags: review?(evold) → review+
Commit pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/77522d4e7870ccd1e19494a6c9364c0f2c568d51
Merge pull request #1684 from fred-wang/seamonkey

Bug 1023661 - Add support for SeaMonkey to clipboard, context-menu, panel and selection modules r=@erikvold
Here is the list of module.metadata for which "Firefox" is stated explicitly. It is generated with the command

find addon-sdk/lib/sdk -type f -name '*.js' | xargs grep -A 5 module.metadata | grep Firefox -B2 -A2 > module.metadata.txt

We need to check if "SeaMonkey" can be added in the compatibility list. However, most of the missing modules seem to be UI components, so that might need more work...
Comment on attachment 8516935 [details]
List of module.metadata for which "Firefox" is stated explicitly

@Philip, @Neil : do you see any modules in this list that could be enabled for SeaMonkey too?
Attachment #8516935 - Flags: feedback?(philip.chee)
Attachment #8516935 - Flags: feedback?(neil)
(In reply to Frédéric Wang (:fredw) from comment #21)
> Comment on attachment 8516935 [details]
> List of module.metadata for which "Firefox" is stated explicitly
> 
> @Philip, @Neil : do you see any modules in this list that could be enabled
> for SeaMonkey too?

Anything in /ui/ is unlikely to work especially if you see:
"Firefox": "> 28"
This means Australis which we don't have and are unlikely to have.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #8516935 - Flags: feedback?(philip.chee)
Comment on attachment 8516935 [details]
List of module.metadata for which "Firefox" is stated explicitly

The module names don't help me understand what's what so all I can guess is that some of the Places stuff might work.
Attachment #8516935 - Flags: feedback?(neil)
(In reply to neil@parkwaycc.co.uk from comment #23)
> Comment on attachment 8516935 [details]
> List of module.metadata for which "Firefox" is stated explicitly
> 
> The module names don't help me understand what's what so all I can guess is
> that some of the Places stuff might work.

The source code is available at https://github.com/mozilla/addon-sdk/tree/master/lib/sdk
Attachment #8511501 - Attachment description: Pull request → Pull request for clipboard, context-menu, panel and selection modules
From a quick look at the places/ modules, it seems they are essentially wrappers to XPCOM backend so they should work on SeaMonkey. Tested with a very minimal add-on:

  let { search } = require("sdk/places/history");
  let { getFavicon } = require("sdk/places/favicon");
  let { Bookmark, save } = require("sdk/places/bookmarks");

  // Test history: search the most visited bug page on Bugzilla
  search(
    { url: "https://bugzilla.mozilla.org/*" },
    { sort: "visitCount" }
  ).on("end", function (results) {
      // Extract the favicon url on the Bugzilla page.
      getFavicon(results[0].url).then(function (url) {
          // Save the favicon in the bookmarks.
          let bookmark = Bookmark({ title: results[0].title + " - Favicon",
                                    url: url });
          let emitter = save(bookmark);
      });
  });
Attachment #8518753 - Flags: review?(evold)
Basic add-on with the source of comment 25, compiled with attachment 8511501 [details] [review]  and "cfx xpi -o --no-strip-xpi".
Attachment #8516935 - Attachment is obsolete: true
Attachment #8518753 - Flags: review?(evold) → review+
Commits pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/0d47a4193ca37bcf786f3c9d674ff19f24196b25
Bug 1023661 - Add support for SeaMonkey to "places" modules

https://github.com/mozilla/addon-sdk/commit/cd1817706704873e0fe32cc68dce90ce038f371d
Merge pull request #1703 from fred-wang/seamonkey-places

Bug 1023661 - Add support for SeaMonkey to "places" modules r=erikvold
> https://github.com/mozilla/addon-sdk/tree/master/lib/sdk/widget.js
Nothing here is Firefox specific except perhaps:
> const AUSTRALIS_PANEL_WIDE_WIDGET_CUTOFF = 70;
> const AUSTRALIS_PANEL_WIDE_CLASSNAME = "panel-wide-item";
I don't think these matter for SeaMonkey.

> https://github.com/mozilla/addon-sdk/tree/master/lib/sdk/ui/sidebar.js
> https://github.com/mozilla/addon-sdk/tree/master/lib/sdk/ui/sidebar/view.js
Our sidebar implementation is completely different. The sidebar module unlikely to be SeaMonkey compatible.

> https://github.com/mozilla/addon-sdk/tree/master/lib/sdk/ui/state.js
> https://github.com/mozilla/addon-sdk/tree/master/lib/sdk/ui/state/events.js
These look OK.

> https://github.com/mozilla/addon-sdk/tree/master/lib/sdk/ui/button/view/events.js
/lib/sdk/ui/button/view.js <-- this depends on Firefix specific CustomizableUI.jsm

> https://github.com/mozilla/addon-sdk/tree/master/lib/sdk/panel/window.js
This looks OK.

I found one Firefox specific constant:
http://mxr.mozilla.org/mozilla-central/source/addon-sdk/source/lib/sdk/window/utils.js?rev=c91dddf4988b#29
>        URI_BROWSER = 'chrome://browser/content/browser.xul',
In SeaMonkey this is: chrome://navigator/content/navigator.xul
What the SDK should do is to look at a char preference "browser.chromeURL" e.g.

let prefs = require("./preferences/service");
const BROWSER = 'navigator:browser',
      URI_BROWSER_PREF = 'browser.chromeURL',
      URI_BROWSER = prefs.get(URI_BROWSER_PREF, 'chrome://browser/content/browser.xul'),
      NAME = '_blank',
      FEATURES = 'chrome,all,dialog=no,non-private';

See also: http://mxr.mozilla.org/comm-central/search?string=browser.chromeURL
Flags: needinfo?(philip.chee)
(In reply to Philip Chee from comment #29)
> I found one Firefox specific constant:
> http://mxr.mozilla.org/mozilla-central/source/addon-sdk/source/lib/sdk/
> window/utils.js?rev=c91dddf4988b#29
> >        URI_BROWSER = 'chrome://browser/content/browser.xul',
> In SeaMonkey this is: chrome://navigator/content/navigator.xul
> What the SDK should do is to look at a char preference "browser.chromeURL"

OK, here is a pull request to address that issue. Tested with a minimal test:

     var utils = require('sdk/window/utils');
     utils.open();
Attachment #8519478 - Flags: review?(evold)
As I understand, these are low-level modules that are used by the higher-level ui modules or by the tests. Not sure whether it's very useful to use them directly, but there is nothing incompatible with SeaMonkey in these files, so let's declare them compatible too.
Attachment #8519530 - Flags: review?(evold)
(In reply to Philip Chee from comment #29)
> > https://github.com/mozilla/addon-sdk/tree/master/lib/sdk/widget.js
> Nothing here is Firefox specific except perhaps:
> > const AUSTRALIS_PANEL_WIDE_WIDGET_CUTOFF = 70;
> > const AUSTRALIS_PANEL_WIDE_CLASSNAME = "panel-wide-item";
> I don't think these matter for SeaMonkey.

I tried to enable the "widget" module and I tested the first example of https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/widget. Unfortunately, I get "Message: TypeError: CustomizableUI is undefined", which I guess is the problem you mention for ui/button/view.js. Indeed, CustomizableUI is used in the _insertNodeInToolbar function. So I believe the two last commits are the best we can do for SeaMonkey for now...

The one remaining thing we would definitely like is the ability to have SeaMonkey (or Thunderbird etc) added to the install.rdf file (ideally detected automatically by verifying the required modules or otherwise by stating explicit compatibility as in bug 724276 comment 17). @Erik Vold: any plans or ideas to do that?
Flags: needinfo?(neil) → needinfo?(evold)
Flags: needinfo?(evold)
Attachment #8519530 - Flags: review?(evold) → review+
Commits pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/82f7350d8e761e8b3f267426dd0c127d30994dab
Bug 1023661 - Declare some low-level modules compatible with SeaMonkey. r=erikvold

https://github.com/mozilla/addon-sdk/commit/b160694da8b753fa41885c9d37a331744357188f
Merge pull request #1707 from fred-wang/seamonkey-lowlevel

Bug 1023661 - Declare some low-level modules compatible with SeaMonkey r=erikvold
Attachment #8519478 - Flags: review?(evold) → review+
Commits pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/33be121bcef6e8f238e2f94c1392ed0e8eb39874
Bug 1023661 - make window/utils.js use the 'browser.chromeURL' preference instead of 'chrome://browser/content/browser.xul'. r=erikvold

https://github.com/mozilla/addon-sdk/commit/bfe9cf007c2e9c3c79f4edeaf5475cb8cf2f2370
Merge pull request #1706 from fred-wang/utils-chromeURL

Bug 1023661 - make window/utils.js use the 'browser.chromeURL' preference instead of 'chrome://browser/content/browser.xul'. r=erikvold
Depends on: 1009938
Attachment #8518758 - Attachment is obsolete: true
Interesting FYI: http://stackoverflow.com/questions/26730618/replace-deprecated-sdk-widget-without-using-toolbar-from-australis#answer-26893863

Quote:
> You can fork the widget module and publish it on npm and try to support 
> it.
> 
> Just copy and paste it to a new module, remove the deprecation warnings, 
> and publish that on npm, and start using it with jpm
Blocks: 1114752
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: