A very simple Miniblink and Python 3 binding example via ctypes. Sketchy and rough prototype as it is, it might, someday in the future, become a not bad candidate to get a quick view of Miniblink.
Miniblink is a super lightweight web browser widget library, spiritual successor of WKE, specialized for developing HTML5 Web UI App (on Windows), whose kernel highly compactly integrated Chromium Blink, V8, etc.
For more information, you may checkout Miniblink Github page and official product website (maybe Chinese only).
Belows are some notable things about Miniblink I would like to share in personal:
- Dynamic library, C-style API exported, concise and simple
- Ready to use as an HTML5 Web UI engine
- Kernel based on Chromium, BUT extremely lightweight
- about 30 MB (32-bit) and 40 MB (64-bit), less than 10 MB after 7z compressed.
- Only supports Windows platform currently
- from Windows XP to 10 and no need for any extra runtime.
- Open-source before but CLOSE NOW to be against annoying forks that violated open-source license
- Provided with Free and Commercial solution, two sets of incompatible API
- This demo is for Miniblink Free solution.
Personal opinion: Miniblink vs CEF3 vs Electron
Aspect | Winner Order |
---|---|
Powerful | CEF3 ≈ Electron >> Miniblink |
Easy to Use | Electron >> Miniblink >> CEF3 |
Lightweight | Miniblink >> CEF3 > Electron |
Windows Compatibility | Miniblink >> CEF3 > Electron |
Cross Platform | Electron >> CEF3, Miniblink: N/A, out |
* Miniblink is referred to Miniblink Free solution.
- Windows platform, as the only platform that Miniblink supports at present.
- Download a Miniblink pre-complied binary release if you haven't had a copy of that yet. Here (Miniblink releases), you may find Miniblink releases, the binary library is usually packed in compression with C header file and other useful resources.
- Extract either all files or only
node.dll
(32-bit) andminiblink_x64.dll
(64-bit) from the downloaded release compressed file and place them/it in the same folder ofmain.py
.
The answer depends on what-bit (architecture) Python interpreter you are going to use to run this demo.
It must be clear that a dynamic library can only be loaded when it is of same-bit (architecture) as its host program, otherwise system will fail it. That means 32-bit process loads 32-bit library, 64-bit process loads 64-bit library, and no hybrid.
32-bit Miniblink | 64-bit Miniblink | |
---|---|---|
32-bit Python | ✔ | ❌ |
64-bit Python | ❌ | ✔ |
node.dll
is for 32-bit and miniblink_x64.dll
is for 64-bit.
- If you are to use 64-bit, it is highly recommended to rename
miniblink_x64.dll
tonode.dll
.
Run main.py
via python
or launcher py
:
py main.py # or python main.py
or use pyw
(or conventional pythonw
) to run demo without console:
pyw main.py # or pythonw main.py
or use py -3-32
or py -3-64
to specify a 32-bit or 64-bit Python 3.
-
main_mini.py
: The minimal code to run Miniblink in Python.(And it's standalone, click-to-run with Python Standard Library!) -
main.py
: (In progress) Added some fun stuff (events, etc.) based onmain_mini.py
. -
official_demo_transcript
: (Coming soon) A Python transcript of the Miniblink official demo (origins from C++ demo_src).
MIT License
I, actually a Python newbie... Sorry for any messy code or bad style, and, please feel free to point them out.