Uncategorized

Creating a Browser Extension using Python



I am trying to create a Browser Extension that uses Python and have been unable to make my script work as an extension in any way.
I believe I need to make Javascript or HTML;
a) Call a Python script
b) Parse some information
c) Execute the script
d) Return the result.
OR — IS THERE ANOTHER WAY TO ACHIEVE THIS??
AM I GOING ABOUT THIS THE WRONG WAY??
Below I have listed the different ways I have attempted;
1. Flask
I started by creating a Flask application. At the time I did not realise that Flask is primarily for creating browser applications (glorified websites) and not browser extensions. Hence why I abandoned this route.
2. PyScript
Following the Flask attempt, I found Pyscript. Again, this method did not work because PyScript did not support the libraries/modules that I use in my Python script.
3. Brython
I was unable to make Brython work because Brython can only import Pure Python libraries/modules. Some of the libraries I use are not Pure Python, hence why this method did not work.
4. Javascript/Different Language
I have been unable to convert my script to another, more browser friendly script due to the fact that I am using Python unique libraries/modules that do not appear in another language.
Unfortunately, as mentioned, I have failed in all my attempts and have wasted countless hours pursuing this.
I am hoping that someone has tried this in the past (or something like it) and knows how to accomplish this and/or can make some suggestions.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *