Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrating Chrome Extension to Firefox

I have a chrome extension with a manifest.json file containing basically this:

"content_scripts": [
{
  "matches": ["*://mail.google.com/mail/*"],
  "js": ["safegmailbootstrap.js","cryptojs/rollups/aes.js", "javascrypt/aes.js", "javascrypt/md5.js", "javascrypt/aesprng.js", "javascrypt/jscrypt.js", "javascrypt/entropy.js"]
}

I'm trying to build a firefox extension, I've created all the structures, but still can't make it work in firefox.

I think I'm writing the XUL file in /chrome/content wrong.

I've tried writing it like this:

<?xml version="1.0"?>
<overlay id="sample" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="safegmailbootstrap.js" />
<script src="cryptojs/rollups/aes.js" />
<script src="javascrypt/aes.js" />
<script src="javascrypt/md5.js" />
<script src="javascrypt/aesprng.js" />
<script src="javascrypt/jscrypt.js" />
<script src="javascrypt/entropy.js" />
</overlay>

I don't know which is the analogous of json chrome file "matches" to firefox extension.

like image 459
jacktrades Avatar asked Jul 17 '12 21:07

jacktrades


1 Answers

You might find it easier using the addon SDK:

https://addons.mozilla.org/en-US/developers/docs/sdk/latest/packages/addon-kit/page-mod.html

https://addons.mozilla.org/en-US/developers/builder

like image 131
Yansky Avatar answered Oct 29 '22 16:10

Yansky