Turning a browser plugin into an XPI - macos

I have a very old (1992) browser plugin for a mac that works in several different browsers. However, since Firefox restricted its plugins to XPI files in Firefox 3.6, the plugin no longer works.
I haven't been able to find a useful document describing what I need to do to my plugin to make it an XPI, or at least loadable by firefox, can anyone point me at such a document? or just explain to me what I need to do? I'm using Xcode.

Brain; the problem is most likely that in Firefox 3.6 they removed support for XPCOM interfaces on npapi plugins. you need to use npruntime instead.
http://colonelpanic.net/2010/01/firefox-3-6-has-removed-support-for-xpcom-plugins/
You could also consider using FireBreath to rewrite it with, as that abstracts a lot of the details.

So if this is an NPAPI plugin, you can just create a simple XPI (it's a ZIP file):
your-plugin.xpi/
install.rdf
plugins/
your-plugin.dylib
This follows from the https://developer.mozilla.org/en/Bundles page I linked earlier.
You can create the install.rdf by reading and following the install.rdf reference page on MDC or just generate a stub extension using something like
Extension Wizard (here's a "more official" version on addons.mozilla.org, but I haven't used that) and take the install.rdf from it.
You should probably limit the extension to Mac in your install.rdf (for that you'll have to read the install.rdf reference).
[original answer was:] What technology does the plugin use? XPI is a packaging mechanism; the answer to your question depends on whether the technology you use is still supported in Firefox 3.6.
I didn't think there were cross-browser plugin technologies, that worked in 1992 and are still in use now, so it's hard to guess what kind of plugin you're talking about.

Related

How do I convert a package.json to install.rdf for a Firefox add-on?

I've got a working add-on for Firefox, which was built using the cfx tool. The tool is being depracated in favor of jpm from Firefox 38 onwards. I followed the instructions to make the switch, but while running, I get the term undefined often, even though the add-on works just fine.
JPM undefined Starting jpm run on Magnetz
Creating XPI
JPM undefined XPI created at C:\Temp\example#add-on-1.0.0.xpi (133ms)
Created XPI at C:\Temp\example#add-on-1.0.0.xpi
JPM undefined Creating a new profile
Someone in the forums suggested that the undefined comes from an install.rdf file, which I don't have. I only have a package.json, which is what the cfx-based process requires.
Looking at the contents of typical install.rdf files, it seems to contain more or less the same data as a package.json. Is there any way to convert the package.json to install.rdf?
I've actually not been able to find a recently updated install.rdf for add-ons, with most links talking about the older XUL-based add-ons.
I'm also confused about why a Python-based tool (cfx) favors a JavaScript-based package.json file, whereas the newer JavaScript-based tool (jpm) favors an arguably deprecated XML-based install.rdf.
There is a guide for transitioning to jpm from cfx here. In short, you do not have to create your own install.rdf file, both cfx and jpm create one for you. Install.rdf is an old crufty xml file, but it is necessary for the extension to work at all in Firefox.
The package.json file has a field 'Title' that you can add in order to provide a 'display name' for your add-on - this replaces the older 'fullName' field.
As for the 'JPM undefined' message you see - I think that's actually a bug in JPM.

Trouble Packaging Firefox Extension

I have followed a couple different links that show how to package Firefox extensions. In cfx, my extension runs exactly how I want it. I made my install.rdf and zipped my files, changing the file type to xpi. When I install it in live Firefox, it shows up in my installed extensions, but nothing happens. I have also tried just using the base install.rdf that they post as a sample, but no luck. What am I missing here?
Here's one guide I've been working off of.
You should be using cfx xpi to package your addons, not the docs you pointed to. As #Noitidart pointed out, there are reasons to unpackage that xpi file and repackage it, and that is mentioned in the above link.
There are three ways to make extensions for Firefox. When you're using the add-on SDK (one of the ways), make sure all the docs you're reading are under the developer.mozilla.org/en-US/Add-ons/SDK/ path.
Note that Firefox is making the move from cfx to jpm, so unless you need your extensions to be available on AMO very soon, you should use jpm.

Cannot find a class in RealBasic - RealUnzip

This is a probably a really simple fix, but I'm extremely new to RealBasic and I'm having difficulty finding help.
dim objUnZipIt as new RealUnzip
The error I keep getting is :
There is no class with this name: di objUnZipIt as new RealUnzip
I'm attempting to debug something in a language I don't know, and the original developer is long gone. Where can I find the library? Or possibly make a small alteration to get this running?
Thank you very much.
Edit: Ok, digging through the folders I found a RealZip.dll . Any idea how I can import this ?
The RealZip plugin was provided by a third-party developer whose website has been offline for several years. You can still grab the plugin from the Internet Archive's copy of their site.
Extract the .rbx file into the plugins sub-directory of the REALstudio install directory and restart the IDE. Since this plugin is no longer maintained, there may be issues with using it in a modern version of the IDE (the included demo project works, though, with only a deprecation warning unrelated to the plugin.)
There's also a GZip plugin available on SourceForge (similarly unmaintained) and the commercial MonkeyBread Compression plugin which is actively maintained.

firebreath firefox plugin not found MACOSX

I have been following the following firebreath tutorial:
http://www.firebreath.org/display/documentation/Mac+Video+Tutorial
And in the second video, After i have built my plugin and i am including the ScreenTutorialPlugin.plugin file in the /Library/Internet/Plug-ins section, it doesn't show in firefox, when i go check it in about:plugins, it just doesnt show. But in the terminal when i go check /Library/Internet/Plug-ins, it does show.
when i open a plugin file and it opens in the browser, it says that the plugin doesnt work.
i think this has to do with the file linking part ln -s in the /plug-ins section.
or could the reason be that i use 3 different browsers? safari,firefox and chrome.
Thank you
With the information provided it is difficult to be certain what your issue is, but here are a few things to consider / understand:
FireBreath plugins are NPAPI plugins and thus should work on all three of the browsers you mentioned
The path where it should be installed is "/Library/Internet Plugins", not "/Library/Internet/Plugins" and if you have actually placed it in the latter directory as you indicated and that isn't a typo then this is definitely part of your issue
using ln -s should work if you create a symlink to the actual .plugin directory, but if it doesn't you can always try copying the file itself
If everything built correctly you should have a binary called (plugin name).plugin/Contents/MacOS/(plugin name) where (plugin name) is the name of your plugin
Hopefully some of this helps; if it doesn't, please provide more information about what you have tried and we'll try to help some more. What you are doing definitely should work -- I use plugins created by FireBreath on Mac every day.

npapi - javascript doesnt load the content of a plugin

I wrote a firefox plugin using C++ and used the <EMBED> to load it to html.
In javascript I got the embedded plugin by using document.getElementByID,
but when I tried to call a plugin function, the function was undefined. Moreover,
plugins constructors did not run while loading the page.
The same html file and plugin seems to work on some computers, while it doesnt work on others.
Does anyone have an idea what might by wrong?
How can I debug such an issue?
Can you reproduce it on your computer at first? If not, then try to figure out what systems, browsers, architecture, versions, they are using.
I recall, there are many GECKOSDK's, and each one has a specific version it works for. https://developer.mozilla.org/en/gecko_sdk For example, different SDK's for Firefox 1.5-2.0, FireFox 3.0, Firefox 3.5, and Firefox 3.5
For different browers, make sure you are exposing the right DLL Exports, browsers can vary: http://git.webvm.net/?p=npsimple is a good starting point. You can use firebreath.googlecode.com too as an alternative.
My suggestion would be to use an object tag instead of <embed>. In my experience, doesn't seem to work as reliably.
If I had more information on how your plugin is structured (are you using XPCOM or npruntime?), I might be able to help more.

Resources