I don't fully understand the limitations of web browser extensions. Can I include python in the file I upload and run python files as well? How do web extensions handle any javascript packages inside of it?
Asked
Active
Viewed 170 times
0
-
You can't include a python file, but you can setup an HTTP server with that executes your python script. Then you can use that do HTTP requests to hit your API and get the data back inside the extension. – Keatinge Feb 24 '17 at 17:56
-
@Keatinge But then wouldn't the functioning of the extension be reliant on my server being connected to the internet? Unless it's possible to host the server from the extension on the user's computer. Can an extension download necessary files on a user's computer? – Zachary Johnson Feb 24 '17 at 18:11
-
Yeah it would rely on your server connected to the internet, that's just how it works. The extension can download files, but they will need to be hosted on your server. http://stackoverflow.com/questions/4845215/making-a-chrome-extension-download-a-file/24162238 – Keatinge Feb 24 '17 at 18:17
-
@Keatinge I have a Raspberry Pi I was planning on setting up a server with anyway. So I can have the python scraping data and putting it into a database, and then access that database from the extension? – Zachary Johnson Feb 24 '17 at 18:21
-
Yes that will work – Keatinge Feb 24 '17 at 19:51
1 Answers
0
No, you can not use Python in your actual extension. WebExtensions are JavaScript, HTML, and CSS. You might want to read "What are WebExtensions?" on MDN.
You're extension can communicate with native applications, or over the network to a server. You could use either of those two methods to have functionality that is written in other languages.

Makyen
- 31,849
- 12
- 86
- 121