PyMiniRacer
quickjs
Our great sponsors
PyMiniRacer | quickjs | |
---|---|---|
4 | 4 | |
692 | 166 | |
2.9% | - | |
3.7 | 5.2 | |
4 days ago | 17 days ago | |
Python | Python | |
ISC License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
PyMiniRacer
-
YouTube-dl has a JavaScript interpreter written in 870 lines of Python
Embedding V8 can work quite well: https://github.com/sqreen/PyMiniRacer
You probably have to emulate some of the DOM, but you can interact directly with whatever obfuscated/packed scripts in a more lightweight and secure way than driving an entire browser.
-
connecting languages
First learn what forms computer code can be in. Source code combine js and python or to combine c and C++ object code with a linker or at runtime if you want to shell out and run from the prompt
-
Web Browser Engineering
If you want battle-hardened, I figure you can't do better than V8. Here's a Python wrapper that I've poked at a bit (it's not quite 100% feature-complete but it seems to essentially work): https://github.com/sqreen/PyMiniRacer
quickjs
-
AWS Introduces a New JavaScript Runtime for Lambda
You can use it as en embedded scripting language within Python.
[1] https://github.com/PetterS/quickjs
- YouTube-dl has a JavaScript interpreter written in 870 lines of Python
-
Why are the upcoming qutebrowser extensions only “inspired” by the WebExtensions API?
You could run the webextention javascript in quickjs.
-
Web Browser Engineering
I was interested to see that this uses the DukPy wrapper around Duktape for the JavaScript interpreter: https://browser.engineering/scripts.html
This made me start digging into whether this was considered a "safe" way of executing untrusted JavaScript in a sandbox.
its not completely clear to me if DukPy currently attempts safe evaluation - it's missing options for setting time or memory limits on executed code for example: https://github.com/amol-/dukpy
There's a QuickJS Python wrapper here which offers those limits: https://github.com/PetterS/quickjs
I'm pretty paranoid though any time it comes to security and dependencies written in C, so I'd love to see a Python wrapper around a JavaScript engine that has safe sandbox execution as a key goal plus an extensive track record to back it up!
What are some alternatives?
dukpy - Simple JavaScript interpreter for Python
Playwright - Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
mini_racer - Minimal embedded v8
tube-get - A tube-site downloader
libv8-node - Package libv8 from Node
InsideReCaptcha - Reverse-engineering the new “captchaless” ReCaptcha system...
Duktape - Duktape - embeddable Javascript engine with a focus on portability and compact footprint
awesome-python - An opinionated list of awesome Python frameworks, libraries, software and resources.
nitter - Alternative Twitter front-end
pyduktape - Embed the Duktape JS interpreter in Python