Coder Social home page Coder Social logo

webruntime's People

Contributors

ad115 avatar alexveden avatar almarklein avatar andrewgrz avatar caph1993 avatar ceprio avatar dwillmer avatar emilio avatar gitter-badger avatar gregfreeman avatar grimmaldi avatar hittingsmoke avatar ivoflipse avatar jrversteegh avatar kamoser avatar kevinlondon avatar konubinix avatar ksengine avatar lewisneal avatar maxyme avatar pierrejean-coudert avatar pigay avatar sesh avatar stonebig avatar toddrme2178 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

webruntime's Issues

_common.py exe_name on MacOS

exe_name, ext = op.splitext(op.basename(sys.executable))
This line is splitting something like /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

Runtime based on Firefox' engine

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.

  • There was Positron but is discontinued.
  • Qbrt is a "CLI to a Gecko desktop app runtime".
  • Servoshell is something similar based on Servo.
  • Maybe we create an actual XUL app?

Unable to launch a webruntime on Win10 x64 Python 3.6

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?

1. Installed flexx over latest master

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

2. Installed webruntime directly

pip install webruntime
Successfully installed webruntime-0.5.2

The webruntime does not seem to work when installed standalone either:
image
image

3. Installed flexx over pip

pip install flexx
Successfully installed flexx-0.4.1
image
image

I cannot use 'app' as webruntime

EDIT:

Somewhere I found the list of available runtimes as I dug into the code and tested all of them:

image
image

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.

Electron runtime

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?

XULRunner error

image

Error: App:Name not specified in application.ini

The application.ini is being created in the temp app folder correctly, so I am not sure what's going on. I'm on Firefox Nightly 93.0a1 though

Could not detect a suitable backend among ['firefox-browser']

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.

How to focus the dom on launch?

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.

Could not detect a suitable backend among ['googlechrome-browser', 'chromium-browser']

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]
Chrome

Making single-process desktop apps?

If one wants to develop a desktop app, then having the two processes (Python process + webruntime) is annoying. Some issues:

  • You probably don't want to show a window for the Python process. But then you are missing any Python logging / tracebacks, unless you somehow send these back to the webruntime.
  • If either process is killed, the other should die as well. We've built things to make this work, but its hard, and not bulletproof.
  • It can be confusing in some cases that the main app is not the thing that provides the window.
  • You cannot "pin applications to the taskbar", because the process associated with the window is not one of which the executable should be started ...

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.

Running app runtime in fullscreen doesn't go over the taskbar

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:

  • Initially the "window" size is the default one (640x480 according to the webruntime source) even though it's borderless like it should.
  • If I minimize it by clicking the taskbar icon and click it again to display the window again, then it's the correct size (fullscreen) but Windows' taskbar is still visible.

Any help would be greatly appreciated! Thanks

Unicode error in get_pid_list()

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

Icon not working in firefox runtime

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.