Editing existing Firefox Add-on

岁酱吖の 提交于 2019-12-04 15:36:53

Zipped the directory making sure that the name is the same and changed extension back to xpi.

I guess that you did something wrong in this step. Looking at the source code, the message comes from method updateMetadata() - Firefox noticed that the file changed and tries to read in install.rdf again. That file should be at the top level of the XPI file but in your case it cannot be found. Maybe install.rdf is no longer at the top level after you repacked the file. You can test it with the unzip command:

unzip -l inspector@mozilla.org.xpi

It should show the contents of the XPI file, including install.rdf and chrome.manifest - without any prepended directory name.

linguini

@Luka, I guess Wladimir Palant is correct. To avoid error during the modification of source code of the existing project, I would suggest you to work in the working environment.

The suggested way to edit your source code:

  1. Install Eclipse
  2. Install Xul booster (project / docs)
  3. Extract your sour code from FF profile.
  4. Check the name of the main folder and subfolder as exactly given in you extracted .Zippy file (FF extension).
  5. Create a new project in Eclipse under XUL booster environment: please use the same name of your FF extension main folder and sub folder.
  6. Then, copy paster your extracted files to the XUL project in Eclipse.
  7. Modify your code & extract as .XPi file and Install in you FF browser.

This way you can avoid any kind of errors because everything will be classified automatically (Chrome folder, manifest, install.rdf, did dies etc).

Note: There is an advanced way of modifying source code and FF browser wil detect the modification of your source code automatically by setting the environment in your FF extension profile folder.

  1. Create a bat file and locate your project folder path and type your extension id inside the FF extension profile folder. (guide)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!