flexxui / webruntime Goto Github PK
View Code? Open in Web Editor NEWLaunch HTML5 apps in the browser or a desktop-like runtime.
Home Page: http://webruntime.readthedocs.io
License: BSD 2-Clause "Simplified" License
Launch HTML5 apps in the browser or a desktop-like runtime.
Home Page: http://webruntime.readthedocs.io
License: BSD 2-Clause "Simplified" License
New Microsoft Edge is based on Chromium.
It would be nice and easy to support it as a runtime.
webruntime/webruntime/_common.py
Line 389 in 5868b77
/usr/local/opt/python/bin/python3.7
to have ext be 7
and making the exe_name on the next line be python3-ui.7
which isn't actually available in the directory it's trying to run from...
/Users/<someUser>/Library/Application Support/webruntime/temp_apps/firefox_1556661877_1~26506/python3-ui.7.app/Contents/MacOS
$ ls
XUL libfreebl3.dylib libmozglue.dylib libplugin_child_interpose.dylib python3-ui
crashreporter.app liblgpllibs.dylib libnss3.dylib libsoftokn3.dylib updater.app
firefox libmozavcodec.dylib libnssckbi.dylib pingsender
firefox-bin libmozavutil.dylib libnssdbm3.dylib plugin-container.app
For MacOS the temp workaround is to just comment out the next line + ext
part. Not doing this causes builtins.ValueError: Could not detect a suitable backend among ['firefox-app', 'nw-app'].
error message but after a bunch of print statements I found the buggy part :D
Perhaps for a longer term fix is to just add ext for the other OS platforms? Or just list the directory files where app_exe is found and see what ext is if any?
NOTE: This issue manifests in the current master branch and the one in pypi for flexx
Electron is nice, but it's heavy use of memory and multiple processes makes it less practical for small applications. Firefox is known to be much lighter in that respect.
Some background: Firefox' main engine is called Gecko, Servo is a more experimental version based on Rust, many features developed here have been backported to Gecko and also to Quantum, the successor of Gecko.
I know that the whole project remains in Alpha so far and is under active change currently.
Since I would like to try out flexx already, could you please guide me how to successfully launch a (standalone) app?
The module flexx.webruntime was not available after installing flexx the way described in the flexxun/flexx github README
pip install https://github.com/flexxui/flexx/archive/master.zip
Successfully installed flexx-0.4.2.dev0 webruntime-0.5.2
pip install webruntime
Successfully installed webruntime-0.5.2
The webruntime does not seem to work when installed standalone either:
I cannot use 'app' as webruntime
Somewhere I found the list of available runtimes as I dug into the code and tested all of them:
So XulRuntime, ChromeAppRuntime and Browser(s) seem to work for me.
Maybe I have missed where you mentioned how to select the "correct" runtime in the docs,
please let me know if I missed it or if you decided to insert this piece of information.
Chrome browser control that runs inside the Python process. Should make a few things simpler. https://github.com/cztomczak/cefpython
Would like to have support for file / folder selection dialogs, as Electron offers them, to have access to the filesystem path so it can be communicated to the backend.
I'm not aware of any other runtimes that are currently supported by Flexx that have this functionality, is that correct?
Running the example with webruntime v0.5.7
rt = launch('http://xkcd.com', 'firefox-browser')
gives error:
[snip] _\webruntime\__init__.py", line 200, in launch
raise ValueError('Could not detect a suitable backend among %r.' % runtimes)
ValueError: Could not detect a suitable backend among ['firefox-browser']._
and choosing chrome:
[snip] _\webruntime\__init__.py", line 200, in launch
raise ValueError('Could not detect a suitable backend among %r.' % runtimes)
ValueError: Could not detect a suitable backend among ['googlechrome-browser', 'chromium-browser']._
The only browser which launches is edge.
After launching a flexx app with app.launch('app')
, the document seems not to be focused ( document.hasFocus()
returns false).
Is it possible to have the DOM focused on launch? Some functions, such as focusing particular elements rely on the DOM being focused on the first place.
Despite adding path for chrome canary in #27 the chrome-browser still fails:
N:\git\webruntime>webruntime https://www.abc.net.au/ chrome-browser
Traceback (most recent call last):
File "c:\users\lewisneal\appdata\local\programs\python\python38\lib\runpy.py", line 194, in run_module_as_main
return run_code(code, main_globals, None,
File "c:\users\lewisneal\appdata\local\programs\python\python38\lib\runpy.py", line 87,
in run_code
exec(code, run_globals)
File "C:\Users\lewisneal\AppData\Local\Programs\Python\Python38\Scripts\webruntime.exe_main.py", line 7, in
File "c:\users\lewisneal\appdata\local\programs\python\python38\lib\site-packages\webruntime_main.py", line 32, in main
rt = webruntime.launch(sys.argv[1], sys.argv[2])
File "c:\users\lewisneal\appdata\local\programs\python\python38\lib\site-packages\webruntime_init.py", line 200, in launch
raise ValueError('Could not detect a suitable backend among %r.' % runtimes)
ValueError: Could not detect a suitable backend among ['googlechrome-browser', 'chromium-browser'].
[end]
If one wants to develop a desktop app, then having the two processes (Python process + webruntime) is annoying. Some issues:
I'm playing with the idea of defining some sort of API to access the system, which can be exposed via Python or Electron / whatever. Then (Flexx) apps can be created and deployed using Electron or a Gecko-like runtime.
Hey there!
I'm on Windows 10 and trying to show my flexx app in fullscreen. I tried to pass windowmode='fullscreen'
or windowmode='kiosk'
to my app.launch('app'...)
call but I have a couple of issues:
Any help would be greatly appreciated! Thanks
I am running a flexx app e.g. as
app.launch('chrome-app', title='Test', size=(100, 100))
But both title and size arguments are ignored. They work for firefox-app
.
This was mentioned in a Flexx issue (flexxui/flexx#471 (comment)) by @zappfinger:
Most examples work good, but the form example gives me:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/Users/richard/anaconda/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/Users/richard/anaconda/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/Users/richard/py35env/lib/python3.5/site-packages/webruntime/_common.py", line 107, in <lambda>
t = threading.Thread(target=lambda: time.sleep(4) or clean_dirs())
File "/Users/richard/py35env/lib/python3.5/site-packages/webruntime/_manage.py", line 221, in clean_dirs
pids = get_pid_list()
File "/Users/richard/py35env/lib/python3.5/site-packages/webruntime/_manage.py", line 137, in get_pid_list
out = subprocess.check_output(cmd).decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 46623: invalid continuation byte
Exception in thread Thread-2:
Traceback (most recent call last):
File "/Users/richard/anaconda/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/Users/richard/anaconda/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/Users/richard/py35env/lib/python3.5/site-packages/webruntime/_common.py", line 107, in <lambda>
t = threading.Thread(target=lambda: time.sleep(4) or clean_dirs())
File "/Users/richard/py35env/lib/python3.5/site-packages/webruntime/_manage.py", line 221, in clean_dirs
pids = get_pid_list()
File "/Users/richard/py35env/lib/python3.5/site-packages/webruntime/_manage.py", line 137, in get_pid_list
out = subprocess.check_output(cmd).decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 46375: invalid continuation byte
Traceback (most recent call last):
File "/Users/richard/PycharmProjects/FlexxTest/flexxTest.py", line 49, in <module>
m = flx.launch(ThemedForm, 'app')
File "/Users/richard/py35env/lib/python3.5/site-packages/flexx/app/_funcs.py", line 231, in launch
return a.launch(runtime, **runtime_kwargs)
File "/Users/richard/py35env/lib/python3.5/site-packages/flexx/app/_app.py", line 166, in launch
session._runtime = webruntime.launch(url, runtime=runtime, **runtime_kwargs)
File "/Users/richard/py35env/lib/python3.5/site-packages/webruntime/__init__.py", line 200, in launch
raise ValueError('Could not detect a suitable backend among %r.' % runtimes)
ValueError: Could not detect a suitable backend among ['firefox-app', 'nw-app'].
Process finished with exit code 1
The default icon for firefox-app is a black X with an orange tape. I launched the app with icon='some_icon.png'
and icon='some_icon.ico'
and it had no effect. I am on linux.
I will create a pull request, as I solved it. I found how to fix it here.
Once the site specific browser feature of FF rolls out, we may use that instead of XUL to launch apps with a Firefox runtime.
(As suggested in #15)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.