Using Python to develop add-on

Hello everyone.

I’m very new to this but I intend to develop an add-on for Mozilla Firefox by using Python.

Is this possible and are there any compatibility issues?

I have done some research and am still unsure if it is encouraging to use Python for the development.

I just know a little about PyXPCOM and that I have to use this to develop the add-on in Python, is this true?

Are there tutorials or materials that use Python to develop add-on, this would definitely help a bunch as development in Python is very limited.

Kindly advice, thank you.

1 Like

Moved from Uncategorized to appropriate category.

Add-ons are mostly written in JavaScript, see MDN.

What’s your addon idea i can give you a simple template to start off.

However if you’re very new it might be easier to kick it off with addon sdk:

Well, I didn’t actually have much of a choice as it is a task to write my system using Python, therefore I hope to use Python to make the add-on. Any suggestions or advice?

Hmm, my system reads URLs, maybe you can provide a simple template on that?

However, my main question is still this; is an add-on possibly done via Python? It is my task to make my system using Python.

Otherwise, are there suggestions?

No, it is not possible to write Firefox Add-ons in Python. Your best shot is still JavaScript. You might want to have a look at our Add-on SDK. It sounds like it could fit your needs.

1 Like

Can you elaborate more I can really hook you up with a good solid start.

Is it possible to create a script based on Python then have the add-on made in JavaScript to execute the script?

The script will expect user prompts and redirect web pages as I plan to make a toolbar.

I’m planing to make a security system as this is my university project.

It detects malicious links and then my system needs to act upon them by redirecting user and warn the user too.

My project requires me to use Python to develop the system. However, I’m still finding ways to make this system available as an add-on browser in Mozilla Firefox. I really need guidance and materials to develop my system.

Kindly advice, thank you.

Yes you can execute exe’s and other things from the addon using child_process: https://developer.mozilla.org/en-US/Add-ons/SDK/Low-Level_APIs/system_child_process

I think you should give addon sdk a shot because running things is possilbe and I do it, but its not as easy as system_child_process.

Check out content scripts to do the link finding and checking for you: https://developer.mozilla.org/en-US/Add-ons/SDK/Guides/Content_Scripts

Then port emit it back to your main.js code and in there execute it with your python script.

2 Likes

All right, then I shall proceed with making out my script first.

Should there be any problems or enquiries, I will post further.

Thank you very much, your reply was very helpful.

For those who couldn’t access it, here are the updated links:

https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Add-on_SDK/Low-Level_APIs/system_child_process

https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Add-on_SDK/Guides/Content_Scripts