# Python within a WebExtension context?

**URL:** <https://discourse.mozilla.org/t/python-within-a-webextension-context/76016>\
**Category:** Development\
**Created:** [February 24, 2021, 7:03am UTC](https://discourse.mozilla.org/t/python-within-a-webextension-context/76016 "2021-02-24T07:03:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![inspector71](https://avatars.discourse-cdn.com/v4/letter/i/3be4f8/32.png) [@inspector71](https://discourse.mozilla.org/u/inspector71)\
**Post date:** [February 24, 2021, 7:03am UTC](https://discourse.mozilla.org/t/python-within-a-webextension-context/76016/1 "2021-02-24T07:03:09Z")

</div>

Can scripts written in Python run within a WebExtension?

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [February 24, 2021, 8:19am UTC](https://discourse.mozilla.org/t/python-within-a-webextension-context/76016/2 "2021-02-24T08:19:24Z")

</div>

WebExtension is basically a web application with access to some special browser API.  
So you can use only languages that are supported by the browser, which is JavaScript and WebAssembly.

However you could use one of the existing transpilers that translates “foreign” language into JavaScript/WebAssembly.  
This is how people using TypeScript or even Scala can write web application.

However, it may bring some overhead depending on what you are trying to do so often it’s not a good idea. It’s best to discuss it with experts.

I remember some Mozilla project about running Python in the browser using WebAssembly:

> **[Pyodide: Bringing the scientific Python stack to the browser – Mozilla Hacks...](https://hacks.mozilla.org/2019/04/pyodide-bringing-the-scientific-python-stack-to-the-browser/)**
>
> Pyodide is an experimental project from Mozilla to create a full Python data science stack that runs entirely in the browser. We think it’s worthwhile to work on moving the ...
