1
$\begingroup$

I am currently trying to develop a chrome extension for a project. My knowledge of Javascript is quite limited and this is my first using it, so I am trying to reduce as much as possible its use. The extension scope will be basically extracting the titles and url from every opened tab and pass this info as a list so it can be used in a python script (applying some text processing and knn/dbscan or other clustering), and getting back those clusters to the extension.

I would appreciate some guidance because, although my project is simple, I am running out of time.

I have been reading lots of information and keep seeing these terms, which make me confused because I don´t know which route I should follow: Restful API, Flask, Django, FastAPI... I just basically want to run a simple python script to execute those actions but don´t seem to find the way to connect both components.

Thank you!

$\endgroup$

1 Answer 1

1
$\begingroup$

I would recommend looking into Brython. This is an implementation of Python that the underlying library converts into Javascript. It isn't a complete drop-in solution as it still suffers from Javascript's limitations regarding file access and cross-site scripting, but it's a lot better than raw Javascript.

If you absolutely must use Python, then you're limited to remote-invocation of Python functions through a REST interface. To my knowledge, there is no browser that will allow you to run Python directly within the browser. The Python interpreter would need to be crippled for security reasons before that could happen.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.