Information about porting extension
Moderators: FranklinDM, Lootyhoof
Information about porting extension
As the Open Casting Call for extension was closed and i wrongly allowed Pale Moon to update to latest version i'd like to receive some information on how to port the only extension i used daily, but i've never developed any XUL add-ons so i don't know where to start, i'm a developer by trade, so it should be much difficult.
Adding Pale Moon GUID i can see that the addon is mostly working except for some functionality, so i'd like to start a debugger and see what is failing, i hope that a guide on how to debug XUL addons (as i think it is) or a list of all compatibility fixes that where removed on 29.2 should suffice i guess, i've tried to open about:debugging, but it seems to be a debugger for the new kind of add-ons, so mine was not listed.
Adding Pale Moon GUID i can see that the addon is mostly working except for some functionality, so i'd like to start a debugger and see what is failing, i hope that a guide on how to debug XUL addons (as i think it is) or a list of all compatibility fixes that where removed on 29.2 should suffice i guess, i've tried to open about:debugging, but it seems to be a debugger for the new kind of add-ons, so mine was not listed.
Re: Information about porting extension
The error console is your friend.
Developer tools -> error console.
Developer tools -> error console.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
Re: Information about porting extension
Thanks moonchild, sadly it doesn't seems to return any error.
My plugin use a jar file inside chrome subfolder, if a add some console.log() to that should i be able to printf-debug it?
My plugin use a jar file inside chrome subfolder, if a add some console.log() to that should i be able to printf-debug it?
Re: Information about porting extension
It depends on how the jar file is handled.
Unpacking it also means you need to repack it using the appropriate format, so make sure you do things properly or it won't work.
Unpacking it also means you need to repack it using the appropriate format, so make sure you do things properly or it won't work.
Re: Information about porting extension
console.log is a chromeism for the web. Only the DevTools Browser or Web Consoles can pick it up not the Toolkit Error Console.
U'd be better importing Services.jsm and using Services.console.logStringMessage(). That will work in any XUL-Based application built with our platform.
U'd be better importing Services.jsm and using Services.console.logStringMessage(). That will work in any XUL-Based application built with our platform.
Re: Information about porting extension
@vannilla: i think it's a zip file? I'm opening it with 7-zip. I don't have any kind of expertise in XUL developement.
@Tobin: Should i "import Services.jsm" inside the .js file i want to debug?
@Tobin: Should i "import Services.jsm" inside the .js file i want to debug?
Re: Information about porting extension
Code: Select all
Components.utils.import("resource://gre/modules/Services.jsm");
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
Re: Information about porting extension
Not really, no.
7-zip does a lot of magic, and I do mean a lot. It does so much magic Harry Potter is a noob (I'm exaggerating to make a point here) so even if 7-zip can open it, it means nothing; you have to examine the file itself using other tools.
In theory, the jar file can be extracted and simply left as-is, but then you'd have to edit the extension to not rely on that jar file but rather to directly read the files in the XPI, which is a similar but slightly different process.
I'm not versed with jar files inside extensions because it's a very old technique that's not necessary anymore, so I can't really help out too much; all I can suggest is to first try a normal zip then renamed to jar (e.g. foo.zip renamed to foo.jar) and if that doesn't work, use the actual jar tool from Java's development suite and see if that works out. The two formats are similar but different enough that one tool can't handle the other, unless it uses the same magic as 7-zip.
Re: Information about porting extension
You can repackage the extension by extracting the contents of the jar file at the same location where they are found, then you'll also have to change chrome.manifest to include the direct path to the resource without the /path/somefile.jar!<internal path inside jar> notation. I've done exactly that for some of the extensions I've forked.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Re: Information about porting extension
Not if the extension reads the actual packed jar file using e.g. XHR on itself.
I've seen it being done, so don't exclude this extension can do the same.
Re: Information about porting extension
Then.. change it lol. The whole reason for the chrome being jar'd was an obsolete practice when extensions were not kept packed. It makes little sense to use the jar reader to stream into an xpi and then into a jar inside. Been that way since gecko/2.
Re: Information about porting extension
Yeah, you can tell an extension being ported is quite old when it uses jars inside.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Re: Information about porting extension
@Moonchild: thank you for the information, i was able to start debugging with this
@Vannilla & tobin: unpacking the jar and modifying the manifest was sufficient to make it run with some modification
@moonbat: i don't think so, last update was on July 2016
@Vannilla & tobin: unpacking the jar and modifying the manifest was sufficient to make it run with some modification
@moonbat: i don't think so, last update was on July 2016
Re: Information about porting extension
I wanted to update all of you to let you know that i was able to fix my extension, i'm sorry i won't share the fixed version as it's not an open source extension afaik.
Thank you all for the support
Thank you all for the support