Firefox Extensions and XPI installer not working - firefox

Hello Im attempting to build a Firefox extension but have run into an issue creating the XPI file,
This tutorial says that the XPI is simply a zip folder renamed, Ive taken a previously installed extension (pinterest) renamed to .zip and it will extract - I can see the plugin files no problem.
If I try and zip then rename my extension to .xpi the plugin will not install - Ive tested this with the pinterest plugin mentioned above and if I rename to zip, extract then rezip and rename back to zpi - the same code will not install. I think there is an issue with the zipping method im using (Windows 7 > Sendto > Compressed .zip)
Just to be clear - I'm not sure my plugin works properly yet, still getting a grip on the files required and naming conventions - however a working package will not work with the same zip process.
Can anyone help with this?

Was zipping from the parent location /folder/contents
Instead of from the contents location
Wokring now.

Related

Converting safari web extension from git repo not successful

I'm trying to convert a chrome web extension to a safari extension.
My environment is a Big Sur VM with XCode 12.5.1.
When I clone the extension's git repo (https://github.com/toobeeh/skribbltypo) and try to convert it with "xcrun safari-web-extension-converter skribbltypo" (from the parent folder), it only spits out the error "Unable to parse manifest at file:///..." (the path points correctly to the repo folder where the manifest lies within).
Web research tells that the issue either may be the folder being a zip (I unsuccessfully tried many ways of downloading the repo as zip, unpacking it, unpacking a signed crx,...) or the path not being correct (I also dragged the folder to the terminal and the file:/// path is correct), with no success.
Does this have to do something with the VM i'm running?
I can't believe I've done it wrong in so many ways.
I'd be glad if someone could try the process.
Thanks in advance.

public folder on redmine doesn't recognize binary files

I have put a binary file (.apk) on redmine/public folder but when I try to download that file I only get the text version of that file as text.
How to change that behavior to direct download?
You need to navigate to the httputils.rb file (it's wherever webrick is installed) and add this line to the list of MIME types:
application/vnd.android.package-archive apk
If that seems like a lot of trouble and you're not trying to do anything fancy with this download (e.g. download it directly from an android phone and install it), you can always wrap it in a .zip and call it a day. Zip files will download automatically.

Install Firebug Extension Manually

I want to install Firebug manually and update configuration settings on my own. I followed below steps:
Downloaded firebug-2.0b1.xpi file (3 MB)
Extracted the content by using winRAR.
put this extracted folder "firebug-2.0b1" inside "C:\Program Files\Mozilla Firefox\extensions"
Now, I run Firefox, but It seems firebug is not installed. This doens't work because some configurations are not done or Profile is not updated. I could like to know if any changes I need to do in folder.
I am doing this because, I couldn't install by drag & drop .xpi file on firefox or install through browser itself.
To install Firebug manually you have to do it differently. There are two ways to run extensions manually:
1. Extract the XPI
Download the XPI file that contains the extension
Locate the 'extensions' folder within your profile (e.g. via Firefox menu > Help > Troubleshooting Information > Show Folder)
Create a new folder within the 'extensions' folder and call it like the add-on's id (for Firebug this is firebug#software.joehewitt.com)
Extract the XPI into that folder
2. Get the sources from the git repository
A detailed description for how to do that can be found on the development setup description on the Firebug wiki. It's similar to the description above with the addition that you'll be able to always get the latest sources.
Two notes:
The folder name must be the same as the addon's ID (look in install.rdf of the addon) In your case it's not firebug-2.0b1 , but firebug#software.joehewitt.com
The directory where the addon should be placed is not where the
Firefox itself is installed, but into your Firefox's profile. By default it's in %APPDATA%\Mozilla\Firefox\Profiles\XXXXX\extensions\ (where XXXXX is name of your profile folder. More info about profiles you can find here)

Create installable Firefox XPI for bootstrapped extension

I downloaded from addons repository a Firefox extension (url shortener), unzipped it and reworked a little bit to use another shortener service - i changed already only a url of shortening service and some names in meta - nothing of vital importance. If i try just to zip all directories and files as they are and try to install - installation fails with an alert
"This addon can't be installed - it could be corrupted"
I guess there are any troubles with zipping of it. I'm even sure, that there is a zipping problem, cause i tried to unzip the original extension, than to zip it without code changes and to install - same error alert.
Also the question is, how to create an installable XPI for the bootstrapped extension (it is:
without .jar-file,
with another directory structure,
installation
withour restart).
The structure of bootstrapped extension (which i have here) is:
/defaults
/locale
/resources
harness-options.json
locales.json
bootstrap.js
install.rdf
options.xul
I use 7-zip, but it is no problem to use any another archiving software.
Thank you for any advice!
Evgeniy
Got it done! Like it describes this answer https://stackoverflow.com/a/18992738/1992004 i zipped a whole folder, what led in error cause of a folder creation inside of archive. After i zipped only included subfolders, i got an installable xpi.

Unzipping and zipping a working .xpi makes it stop working

I downloaded the basic Hello World xpi from Mozilla, and it installed in my Firefox without any problems. Then I unistalled the addon, unzipped the xpi, then, without changing anything inside it, zipped it again using 7zip. I tried to install it, and Firefox gave me a "This addon could not be installed because it appears to be corrupt" error.
Unzipping the .xpi produces a folder with the same name as the .xpi, with its contents. To create a working .xpi, zip the contents of that folder, not the folder itself.
Credit goes to nmaier.

Resources