Extensions FAQ

Talk about add-ons and extension development.
swarnavasengupta
Posts: 39
Joined: October 24th, 2009, 8:52 pm

Re: Extensions FAQ

Post by swarnavasengupta »

I create a mozilla addon but i cant create xpi..somebody can help me?actually i am a begineer in this..help me plz

i create the extension long ago but i dunno how to uplaod it..means i dont know how to create as xpi..i just make the chrome file,default,component etc..but my addon building is complete..

i will like to see you contributor section and those people who help me
User avatar
LIMPET235
Moderator
Posts: 39920
Joined: October 19th, 2007, 1:53 am
Location: The South Coast of N.S.W. Oz.

Re: Extensions FAQ

Post by LIMPET235 »

swarnavasengupta...
Please stay with your original thread. Thank you.
Also....This is not instant chat but a forum.
You may not receive an answer for hrs/days/weeks. ;)
Continue here > viewtopic.php?f=19&t=1553225

Have you read all the supplied links in this thread?
[Ancient Amateur Astronomer.]
Win-10-H/64 bit/500G SSD/16 Gig Ram/450Watt PSU/350WattUPS/Firefox-115.0.2/T-bird-115.3.2./SnagIt-v10.0.1/MWP-7.12.125.

(Always choose the "Custom" Install.)
Blinp
Posts: 11
Joined: June 27th, 2008, 3:24 pm

Re: Extensions FAQ

Post by Blinp »

_development
Posts: 332
Joined: October 19th, 2007, 9:29 am
Location: Montevideo, Uruguay

Re: Extensions FAQ

Post by _development »

phpghz
Posts: 5
Joined: October 22nd, 2009, 4:24 am

Re: Extensions FAQ

Post by phpghz »

love it soooooooooo much ... thank you mr. tech .... you are the mannnn!!!!!!!!!!!!!!!!!!!!!!
_development
Posts: 332
Joined: October 19th, 2007, 9:29 am
Location: Montevideo, Uruguay

Re: Extensions FAQ

Post by _development »

Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Re: Extensions FAQ

Post by Zoolcar9 »

My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
tuecha
Posts: 1
Joined: October 3rd, 2009, 2:07 am

Re: Extensions FAQ

Post by tuecha »

Hi, I'm a starter I've followed many beginning tutorials for Hello world add on! My problem is, Firefox can't see the addon, When I clicked add-on section from the tools, I can see my addon is right there with a (!) mark. Do you have any idea why is that?
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Re: Extensions FAQ

Post by Zoolcar9 »

 
At http://forums.mozillazine.org/viewtopic.php?p=3143954#p3143954, max1million wrote:This thread is not intended to be used for frequently asking questions, but as a reference (of Frequently Asked Questions and where to find info).
 
My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Re: Extensions FAQ

Post by Zoolcar9 »

 
Advantages of using jar archive in extension
http://groups.google.com/group/mozilla.dev.extensions/...
 
My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
globalplayer
Posts: 231
Joined: November 23rd, 2009, 10:37 am

Re: Probleme to create a new Ectension in Firefox 1.5

Post by globalplayer »

MehdiB wrote:Hello, I followed the tutorial to create an Extension but when I run firefox I can read this message "This element cannot be installed because "install.rdf" is incorrect or doesn't exist"

Please can you help me, I followed all this instructions of this site and I don't kniow where is the problem.

Thank You


Although I know your question is four years (!) old, it may still help someone.
I run into exactly the same thing just 2 weeks ago, but solved it myself after lots of groping in the dark.
My development folder was %userprofile%\ffext on Windows.
My app be called 'myapp', so my dev folder was %userprofile%\ffext\myapp where all my files resided, such as:

...myapp\install.rdf
...myapp\chrome.manifest
...myapp\chrome\content\main.js
...myapp\defaults\preferences\prefs.js
...myapp\skin\skin.css

This application, zipped WITH the 'myapp' folder, did not work!!

Instead, if you ENTER 'myapp' directory and THEN zip your extension, it will work!!
(thus leaving out the path)

I'd love to see it working with the path inside, too, though. The way it is ATM, it's just awkward - especially for beginners it's awfully confusing. #-o

Rule of thumb: if the name of your application appears as a directory in the zip, AND the appname is the ONLY thing you see at this level, it will not work. You can, of course, create a folder, "myapp_pre", put 'install.rdf" there, and MOVE all the 'myapp' directory in so that it appears as the subdirectory of "myapp_pre" Then you can enter myapp_pre, and zip the thing from there and it WILL work if you adapt paths accordingly (/myapp/chrome/content instead of /chrome/content, etc.)

If the install.rdf is not DIRECTLY accessible on root level and instead resides in a subdirectory (be it even 100% identical to your application path), the installer will fail. That's just a huge flaw in the concept IMHO.
It ought to search at least in both .\install.rdf and <name of your application>\install.rdf.
penguin_traveller
Posts: 98
Joined: May 25th, 2009, 2:31 am

Re: Extensions FAQ

Post by penguin_traveller »

User avatar
ApocalypeX
Posts: 9
Joined: May 15th, 2010, 1:42 am
Contact:

Re: Extensions FAQ

Post by ApocalypeX »

Where do I actually put my Helloworld folder for my addon?

I've currently put it in this path
C:\Program Files (x86)\Mozilla Firefox\extensions

But nothing is happening.
_development
Posts: 332
Joined: October 19th, 2007, 9:29 am
Location: Montevideo, Uruguay

Re: Extensions FAQ

Post by _development »

Zoolcar9 wrote: 
At http://forums.mozillazine.org/viewtopic.php?p=3143954#p3143954, max1million wrote:This thread is not intended to be used for frequently asking questions, but as a reference (of Frequently Asked Questions and where to find info).
 
Feel free to start a new thread.
semantique
Posts: 3
Joined: May 16th, 2010, 10:41 am

Re: Extensions FAQ

Post by semantique »

the bash build.sh script on http://kb.mozillazine.org/Bash_build_script does not work with any Manifest Flags (cp. http://mdn.beonex.com/en/Chrome_Registration). The file below corrects the regular expression and enables use of those manifest flags. Also the file below ignores any CVS and .svn directories

Code: Select all

#!/bin/bash
# build.sh -- builds JAR and XPI files for mozilla extensions
#   by Nickolay Ponomarev <asqueella@gmail.com>
#   update for manifest flags and .svn ignore (2010/05/16) by Karlheinz Toni <charly@mebb.it>
#
#   (original version based on Nathan Yergler's build script)
# Most recent version is at <http://kb.mozillazine.org/Bash_build_script>

# This script assumes the following directory structure:
# ./
#   chrome.manifest (optional - for newer extensions)
#   install.rdf
#   (other files listed in $ROOT_FILES)
#
#   content/    |
#   locale/     |} these can be named arbitrary and listed in $CHROME_PROVIDERS
#   skin/       |
#
#   defaults/   |
#   components/ |} these must be listed in $ROOT_DIRS in order to be packaged
#   ...         |
#
# It uses a temporary directory ./build when building; don't use that!
# Script's output is:
# ./$APP_NAME.xpi
# ./$APP_NAME.jar  (only if $KEEP_JAR=1)
# ./files -- the list of packaged files
#
# Note: It modifies chrome.manifest when packaging so that it points to
#       chrome/$APP_NAME.jar!/*

#
# default configuration file is ./config_build.sh, unless another file is
# specified in command-line. Available config variables:
APP_NAME=          # short-name, jar and xpi files name. Must be lowercase with no spaces
CHROME_PROVIDERS=  # which chrome providers we have (space-separated list)
CLEAN_UP=          # delete the jar / "files" when done?       (1/0)
ROOT_FILES=        # put these files in root of xpi (space separated list of leaf filenames)
ROOT_DIRS=         # ...and these directories       (space separated list)
BEFORE_BUILD=      # run this before building       (bash command)
AFTER_BUILD=       # ...and this after the build    (bash command)

if [ -z $1 ]; then
  . ./config_build.sh
else
  . $1
fi

if [ -z $APP_NAME ]; then
  echo "You need to create build config file first!"
  echo "Read comments at the beginning of this script for more info."
  exit;
fi

ROOT_DIR=`pwd`
TMP_DIR=build

#uncomment to debug
#set -x

# remove any left-over files from previous build
rm -f $APP_NAME.jar $APP_NAME.xpi files
rm -rf $TMP_DIR

$BEFORE_BUILD

mkdir --parents --verbose $TMP_DIR/chrome

# generate the JAR file, excluding CVS and temporary files
JAR_FILE=$TMP_DIR/chrome/$APP_NAME.jar
echo "Generating $JAR_FILE..."
for CHROME_SUBDIR in $CHROME_PROVIDERS; do
  find $CHROME_SUBDIR -path '*CVS*' -prune -o -path "*/.svn" -prune -o -type f -print | grep -v \~ >> files
done

zip -0 -r $JAR_FILE `cat files`
# The following statement should be used instead if you don't wish to use the JAR file
#cp --verbose --parents `cat files` $TMP_DIR/chrome

# prepare components and defaults
echo "Copying various files to $TMP_DIR folder..."
for DIR in $ROOT_DIRS; do
  mkdir $TMP_DIR/$DIR
  FILES="`find $DIR -path '*CVS*' -prune -o -type f -print | grep -v \~`"
  echo $FILES >> files
  cp --verbose --parents $FILES $TMP_DIR
done

# Copy other files to the root of future XPI.
for ROOT_FILE in $ROOT_FILES install.rdf chrome.manifest; do
  cp --verbose $ROOT_FILE $TMP_DIR
  if [ -f $ROOT_FILE ]; then
    echo $ROOT_FILE >> files
  fi
done

cd $TMP_DIR

if [ -f "chrome.manifest" ]; then
  echo "Preprocessing chrome.manifest..."
  # You think this is scary?
  #s/^(content\s+\S*\s+)(\S*\/)$/\1jar:chrome\/$APP_NAME\.jar!\/\2/
  #s/^(skin|locale)(\s+\S*\s+\S*\s+)(.*\/)$/\1\2jar:chrome\/$APP_NAME\.jar!\/\3/
  #
  # Then try this! (Same, but with characters escaped for bash :)
  sed -i -r s/^\(content\\s+\\S*\\s+\)\(\\S*\\/\)\(.*\)$/\\1jar:chrome\\/$APP_NAME\\.jar!\\/\\2\\3/ chrome.manifest
  sed -i -r s/^\(skin\|locale\)\(\\s+\\S*\\s+\\S*\\s+\)\(.*\\/\)\(.*\)$/\\1\\2jar:chrome\\/$APP_NAME\\.jar!\\/\\3\\4/ chrome.manifest

  # (it simply adds jar:chrome/whatever.jar!/ at appropriate positions of chrome.manifest)
fi

# generate the XPI file
echo "Generating $APP_NAME.xpi..."
zip -r ../$APP_NAME.xpi *

cd "$ROOT_DIR"

echo "Cleanup..."
if [ $CLEAN_UP = 0 ]; then
  # save the jar file
  mv $TMP_DIR/chrome/$APP_NAME.jar .
else
  rm ./files
fi

# remove the working files
rm -rf $TMP_DIR
echo "Done!"

$AFTER_BUILD


Enjoy.

Bests,
Charly
Locked