Firefox & Thunderbird Add-on Converter for SeaMonkey

User Help for Seamonkey and Mozilla Suite
Post Reply
User avatar
patrickjdempsey
Posts: 23686
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC
Contact:

Re: Firefox & Thunderbird Add-on Converter for SeaMonkey

Post by patrickjdempsey »

If that was true, they would have found a way to actually make the reports useful and integrate them into the AMO dashboard in a meaningful way. I really think it was just another marketing-led feature gone wrong.
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/
User avatar
LoudNoise
New Member
Posts: 39900
Joined: October 18th, 2007, 1:45 pm
Location: Next door to the west

Re: Firefox & Thunderbird Add-on Converter for SeaMonkey

Post by LoudNoise »

The line between villainy and incompetence isn't particularly fine. but it doesn't look at all well in retrospect. It is broken in 36 and I would suspect it won't be fixed.
Post wrangler
"Choose between the Food Select Feature or other Functions. If no food or function is chosen, Toast is the default."
User avatar
patrickjdempsey
Posts: 23686
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC
Contact:

Re: Firefox & Thunderbird Add-on Converter for SeaMonkey

Post by patrickjdempsey »

I honestly hope not. Well-intentioned or not, it's lead far too many users astray for far too long. Possibly even directly leading to the deaths of extensions during the Australis uplift because of lack of meaningful reports from users in advance.
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/
User avatar
LoudNoise
New Member
Posts: 39900
Joined: October 18th, 2007, 1:45 pm
Location: Next door to the west

Re: Firefox & Thunderbird Add-on Converter for SeaMonkey

Post by LoudNoise »

Look what happened the themes. Is it much of a surprise they are going to do in extensions in the same passive/aggressive way?
Post wrangler
"Choose between the Food Select Feature or other Functions. If no food or function is chosen, Toast is the default."
Lemon Juice
Posts: 788
Joined: June 1st, 2006, 9:41 am

Re: Firefox & Thunderbird Add-on Converter for SeaMonkey

Post by Lemon Juice »

Time for another update - I made a change to the converter so that Image Picker 1.9.3 now works after conversion. In order to do this I changed the algorithms for Components shortcuts like Cc, Ci, etc. - the converter no longer prepends var definitions for them but instead simply expands the shortcuts to their full versions (like Components.classes, etc.). Adding var definitions was not fully reliable for included files since the converter would have to detect those inclusions, which would be too complicated to do. This is a 'major' change to the converter and I hope it won't impact negatively other extensions - if you find that an extension from the main list does not work then please report it here!

As a result of better addon-sdk compatibility in SM 33 now two extensions get moved from the non-working to the working list: Awesome Screenshot Plus - Capture, Annotate & More and Wappalyzer.

New working extensions (the main list updated on the 1st page):

Image Picker
Save Images
Blank Your Monitor + Easy Reading
I don't care about cookies 2.3.5 - right-click menu entry "Report a cookie warning" does not work
Video Downloader professional
Inspect Context
Awesome Screenshot Plus - Capture, Annotate & More
Wappalyzer

Two extensions (I don't care about cookies and QrCodeR) spit out a common js error:

Code: Select all

console.error: no-eu-cookie-uk:
  Message: TypeError: this.contextMenuContentData is undefined
  Stack:
    updateItemVisibilities@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/lj/AppData/Roaming/Mozilla/SeaMonkey/Profiles/lmf7vii4.test2/extensions/jid1-KzOGWgsW3Ao4Q@jetpack.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js ->resource://gre/modules/commonjs/sdk/context-menu.js:1015:11


To me it looks like the context-menu.js sdk module is buggy in SM in one place - overall it works but has some problems. This would have to be corrected in SM I guess - hopefully, it's something trivial, but has to be further investigated...
*** SeaMonkey — weird name, sane interface, modern bowels ***
Mouse Gestures for SeaMonkey/Firefox
Convert Fx and TB extensions to SeaMonkey
Lemon Juice
Posts: 788
Joined: June 1st, 2006, 9:41 am

Re: Firefox & Thunderbird Add-on Converter for SeaMonkey

Post by Lemon Juice »

RrBd wrote:Are there any statistics how many users already use the converter?

In Jan. 2015 there were 965 conversions, Feb. - 715 conversions, March (still without 3 last days) 878 conversions. I don't know exactly how many users, but quite often one user makes a few conversions in a row.
*** SeaMonkey — weird name, sane interface, modern bowels ***
Mouse Gestures for SeaMonkey/Firefox
Convert Fx and TB extensions to SeaMonkey
RrBd
Posts: 25
Joined: February 25th, 2015, 1:21 am

Re: Firefox & Thunderbird Add-on Converter for SeaMonkey

Post by RrBd »

Thx for Info!

I found out: https://addons.cdn.mozilla.net/user-med ... 0.9-fx.xpi also works fine after conversion with SM 2.33.1 on WIN 7
User avatar
Philip Chee
Posts: 6475
Joined: March 1st, 2005, 3:03 pm
Contact:

Re: Firefox & Thunderbird Add-on Converter for SeaMonkey

Post by Philip Chee »

Lemon Juice wrote:

Code: Select all

console.error: no-eu-cookie-uk:
  Message: TypeError: this.contextMenuContentData is undefined
  Stack:
    updateItemVisibilities@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/lj/AppData/Roaming/Mozilla/SeaMonkey/Profiles/lmf7vii4.test2/extensions/jid1-KzOGWgsW3Ao4Q@jetpack.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js ->resource://gre/modules/commonjs/sdk/context-menu.js:1015:11

To me it looks like the context-menu.js sdk module is buggy in SM in one place - overall it works but has some problems. This would have to be corrected in SM I guess - hopefully, it's something trivial, but has to be further investigated...
I spent some time looking at the code. contextMenuContentData is a global that exists in Firefox but not in SeaMonkey. Here's what happens in multiprocess Firefox. Code runs in both Chrome and in Content. Both sides use the message manager to ping-pong messages back and forth.

The frame script in the content process registers a event listener for the "contextmenu" event, which calls the handleContentContextMenu method.
http://mxr.mozilla.org/comm-central/source/mozilla/browser/base/content/content.js?rev=acd77f938db4#226

Code: Select all

Cc["@mozilla.org/eventlistenerservice;1"]
  .getService(Ci.nsIEventListenerService)
  .addSystemEventListener(global, "contextmenu", handleContentContextMenu, false);

The handleContentContextMenu creates a mostly empty object and then pings this to the addon-sdk using notifyObservers():
http://mxr.mozilla.org/comm-central/source/mozilla/browser/base/content/content.js?rev=acd77f938db4&mark=153-159#135

Code: Select all

  let addonInfo = {};
  let subject = {
    event: event,
    addonInfo: addonInfo,
  };
  subject.wrappedJSObject = subject;
  Services.obs.notifyObservers(subject, "content-contextmenu", null);

The SDK fills the object with various bits of junk and pongs it back to the content frame script:
http://mxr.mozilla.org/comm-central/source/mozilla/addon-sdk/source/lib/sdk/content/context-menu.js?rev=a791126591a4&mark=391-398#391

Code: Select all

system.on('content-contextmenu', ({ subject }) => {
  let { event: { target: popupNode }, addonInfo } = subject.wrappedJSObject;
  lastPopupNode = popupNode;

  for (let item of keepAlive.values()) {
    item.getContextState(popupNode, addonInfo);
  }
}, true);

Which then pings it to the code running in chrome:
http://mxr.mozilla.org/comm-central/source/mozilla/browser/base/content/content.js?rev=acd77f938db4&mark=199-204,209-221#199

Code: Select all

  if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
    let editFlags = SpellCheckHelper.isEditable(event.target, content);
    let spellInfo;
    if (editFlags &
        (SpellCheckHelper.EDITABLE | SpellCheckHelper.CONTENTEDITABLE)) {
      spellInfo =
        InlineSpellCheckerContent.initContextMenu(event, editFlags, this);
    }

    let customMenuItems = PageMenuChild.build(event.target);
    let principal = doc.nodePrincipal;
    sendSyncMessage("contextmenu",
                    { editFlags, spellInfo, customMenuItems, addonInfo,
                      principal, docLocation, charSet, baseURI, referrer,
                      referrerPolicy },
                    { event, popupNode: event.target });
  }
  else {
    // Break out to the parent window and pass the add-on info along
    let browser = docShell.chromeEventHandler;
    let mainWin = browser.ownerDocument.defaultView;
    mainWin.gContextMenuContentData = {
      isRemote: false,
      event: event,
      popupNode: event.target,
      browser: browser,
      addonInfo: addonInfo,
      documentURIObject: doc.documentURIObject,
      docLocation: docLocation,
      charSet: charSet,
      referrer: referrer,
      referrerPolicy: referrerPolicy,
    };
  }

Actually it's smart enough to update gContextMenuContentData directly if it knows it's running in Chrome (i.e. e10s is turned off). Since SeaMonkey is not multiprocess we can short circuit most of this.

Phil
Michael Buckley
Posts: 17
Joined: November 4th, 2007, 10:12 pm

Re: Firefox & Thunderbird Add-on Converter for SeaMonkey

Post by Michael Buckley »

I been working on a JSM file that is trying to Mimic the CustomizableUI.jsm interface but working on SeaMonkey/Thunderbird. I was wondering if the developers of the Converter tool would be interested in adding it in if I extended it to cover more then just the basics of the interface.

https://github.com/codefisher/mozbutton ... izable.jsm
Toolbar Buttons the biggest button pack for Firefox or Thunderbird
Text Formatting Toolbar - make posting easy and fun.
Xrl.in - Tiny URls
barbaz
Posts: 1504
Joined: October 1st, 2014, 3:25 pm

Re: Firefox & Thunderbird Add-on Converter for SeaMonkey

Post by barbaz »

Michael Buckley wrote:I been working on a JSM file that is trying to Mimic the CustomizableUI.jsm interface but working on SeaMonkey/Thunderbird. I was wondering if the developers of the Converter tool would be interested in adding it in if I extended it to cover more then just the basics of the interface.

https://github.com/codefisher/mozbutton ... izable.jsm

I think the SeaMonkey developers were interested in such a thing, don't know if they still are...
viewtopic.php?p=13831121#p13831121
Michael Buckley
Posts: 17
Joined: November 4th, 2007, 10:12 pm

Re: Firefox & Thunderbird Add-on Converter for SeaMonkey

Post by Michael Buckley »

The tracker for adding CustomizableUI.jsm to SeaMonkey itself is https://bugzilla.mozilla.org/show_bug.cgi?id=1011857 I don't know if they actually would. The Pale Moon guys suggested they would rather have it broken completely, then broken partly, since it is almost impossible to get this working perfectly in anything other then Firefox.

What I really trying to work out is: is this the kind of approach people are interested in taking. Making something that mimics the CustomizableUI.jsm file, without actually implementing Australis. Would this be used if I finished it?
Toolbar Buttons the biggest button pack for Firefox or Thunderbird
Text Formatting Toolbar - make posting easy and fun.
Xrl.in - Tiny URls
Lemon Juice
Posts: 788
Joined: June 1st, 2006, 9:41 am

Re: Firefox & Thunderbird Add-on Converter for SeaMonkey

Post by Lemon Juice »

RrBd wrote:I found out: https://addons.cdn.mozilla.net/user-med ... 0.9-fx.xpi also works fine after conversion with SM 2.33.1 on WIN 7

Thanks, added to the list!

Philip Chee wrote:Actually it's smart enough to update gContextMenuContentData directly if it knows it's running in Chrome (i.e. e10s is turned off). Since SeaMonkey is not multiprocess we can short circuit most of this.

Thanks for looking into this. This may be correct that Fx devs recently are introducing changes regarding e10s - I remember testing QrCoder a few SM versions back and it used to work fine after proper sdk patches and now it's throwing errors.

Do you have a bug for adding this global to SM?

Michael Buckley wrote:I been working on a JSM file that is trying to Mimic the CustomizableUI.jsm interface but working on SeaMonkey/Thunderbird. I was wondering if the developers of the Converter tool would be interested in adding it in if I extended it to cover more then just the basics of the interface.

This look very interesting! Currently, I am the only developer of the converter and I find that the lack of customizableUI in SM is the biggest problem now preventing many extensions from being converted successfully so your work will be really appreciated. I believe this should eventually become integrated in SM rather than be injected via the converter - but in either case such a module will be of value.

Michael Buckley wrote:What I really trying to work out is: is this the kind of approach people are interested in taking. Making something that mimics the CustomizableUI.jsm file, without actually implementing Australis. Would this be used if I finished it?

I think this is the actual goal for SM - maintain compatibility without implementing Australis. I will certainly play around with this and if it's in a good working shape I'm sure the devs will integrate it into the core. Of course, Australis-specific functions cannot be supported but in most cases extensions add a simple toolbar button and that's what we would like to work in SM. Additionally, I think the Australis-only functions/methods could be included as stubs so that the extensions do not error out if they attempt some Australis-specific actions - they would simply be ignored.

BTW, how can your module be used at the moment? Suppose I have an extension that makes use of customizableUI - do I include your file in the XPI and then add

Code: Select all

Components.utils.import("/path/to/customizable.jsm");

to the files that need it?
*** SeaMonkey — weird name, sane interface, modern bowels ***
Mouse Gestures for SeaMonkey/Firefox
Convert Fx and TB extensions to SeaMonkey
Michael Buckley
Posts: 17
Joined: November 4th, 2007, 10:12 pm

Re: Firefox & Thunderbird Add-on Converter for SeaMonkey

Post by Michael Buckley »

Unfortunately right now it is not that simple to import, since there are a number of hoops you need to jump though. Though that is kind of the goal to reach.
The sticking point is that I was trying to get it working in Thunderbird/SeaMonkey Mail. CustomizableUI assumes there is only one toolbox per window, Thunderbird can have 2 (or if lightening is installed 3) per window. So right now once imported you have to register it to a toolbox, which is really messy.
I will clean it up, since you are interested, and let you know once I have it working a little smother.
Toolbar Buttons the biggest button pack for Firefox or Thunderbird
Text Formatting Toolbar - make posting easy and fun.
Xrl.in - Tiny URls
Lemon Juice
Posts: 788
Joined: June 1st, 2006, 9:41 am

Re: Firefox & Thunderbird Add-on Converter for SeaMonkey

Post by Lemon Juice »

SeaMonkey Mail has only 1 toolbox so fortunately there is no need to choose which one.

In order for this to work well with the converter the module should work as a simple drop-in because I'm not able to intelligently get the converter to inject some other complicated code into extensions in a way that will work and not break anything. What I can do is fairly confidently detect whether customizableUI is used and if it is then insert the import.

It will be great if it works out, thanks!
*** SeaMonkey — weird name, sane interface, modern bowels ***
Mouse Gestures for SeaMonkey/Firefox
Convert Fx and TB extensions to SeaMonkey
Michael Buckley
Posts: 17
Joined: November 4th, 2007, 10:12 pm

Re: Firefox & Thunderbird Add-on Converter for SeaMonkey

Post by Michael Buckley »

Ok, so I moved all the set up code inside the module and did the toolbox selection another way. Should work just by replacing the import. I also added all the functions, but most just throw an error for now. I will implement them gradually, let me know if there are any that you find are commonly used.
If you find bugs, let me know, maybe best if you do so on github, easier for me to track ;)

https://github.com/codefisher/mozbutton ... izable.jsm
Toolbar Buttons the biggest button pack for Firefox or Thunderbird
Text Formatting Toolbar - make posting easy and fun.
Xrl.in - Tiny URls
Post Reply