You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-24Lines changed: 21 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ Eel is designed to take the hassle out of writing short and simple GUI applicati
25
25
-[Synchronous returns](#synchronous-returns)
26
26
-[Asynchronous Python](#asynchronous-python)
27
27
-[Building distributable binary with PyInstaller](#building-distributable-binary-with-pyinstaller)
28
+
-[Microsoft Edge](#microsoft-edge)
28
29
29
30
<!-- /TOC -->
30
31
@@ -81,34 +82,23 @@ If Chrome or Chromium is installed then by default it will open in that in App M
81
82
82
83
### App options
83
84
84
-
Additional options can be passed to `eel.start()`by passing it an `options={}` argument.
85
+
Additional options can be passed to `eel.start()`as keyword arguments.
85
86
86
-
Some of the options include the mode the app is in ('chrome', 'chrome-app', None), the port the app runs on, the host name of the app, and adding additional Chrome/Chromium command line flags.
87
+
Some of the options include the mode the app is in (e.g. 'chrome'), the port the app runs on, the host name of the app, and adding additional command line flags.
87
88
88
-
The defaults are set to:
89
+
As of Eel 1.0.0, the following options are available to `start()`:
90
+
-**mode**, a string specifying what browser to use (e.g. `'chrome'`, `'electron'`, `'edge'`, `'custom'`). Can also be `None` or `False` to not open a window. *Default: `'chrome'`*
91
+
-**host**, a string specifying what hostname to use for the Bottle server. *Default: `'localhost'`)*
92
+
-**port**, an int specifying what port to use for the Bottle server. Use `0` for port to be picked automatically. *Default: `8000`*.
93
+
-**block**, a bool saying whether or not the call to `start()` should block the calling thread. *Default: `True`*
94
+
-**jinja_templates**, a string specifying a folder to use for Jinja2 templates, e.g. `my_templates`. *Default: `None`*
95
+
-**cmdline_args**, a list of strings to pass to the command to start the browser. For example, we might add extra flags for Chrome; ```eel.start('main.html', mode='chrome-app', port=8080, cmdline_args=['--start-fullscreen', '--browser-startup-dialog'])```. *Default: `[]`*
96
+
-**size**, a tuple of ints specifying the (width, height) of the main window in pixels *Default: `None`*
97
+
-**position**, a tuple of ints specifying the (left, top) of the main window in pixels *Default: `None`*
98
+
-**geometry**, a dictionary specifying the size and position for all windows. The keys should be the relative path of the page, and the values should be a dictionary of the form `{'size': (200, 100), 'position': (300, 50)}`. *Default: {}*
99
+
-**close_callback**, a lambda or function that is called when a websocket to a window closes (i.e. when the user closes the window). It should take two arguments; a string which is the relative path of the page that just closed, and a list of other websockets that are still open. *Default: `None`*
89
100
90
-
```
91
-
_default_options = {
92
-
'mode': 'chrome-app',
93
-
'host': 'localhost',
94
-
'port': 8000,
95
-
'chromeFlags': ""
96
-
}
97
-
```
98
-
99
-
#### Chrome/Chromium flags
100
-
101
-
You can add additional Chrome/Chromium command line flags by passing a list to the `chromeFlags` attribute on the `options` dictionary and then passing this to `eel.start()`
@@ -327,3 +317,10 @@ If you want to package your app into a program that can be run on a computer wit
327
317
6. When happy that your app is working correctly, add `--onefile --noconsole` flags to build a single executable file
328
318
329
319
Consult the [documentation for PyInstaller](http://PyInstaller.readthedocs.io/en/stable/) for more options.
320
+
321
+
## Microsoft Edge
322
+
323
+
For Windows 10 users, Microsoft Edge (`eel.start(.., mode='edge')`) is installed by default and a useful fallback if a preferred browser is not installed. See the examples:
324
+
325
+
- A Hello World example using Microsoft Edge: [examples/01 - hello_world-Edge/](https://github.com/ChrisKnott/Eel/tree/master/examples/01%20-%20hello_world-Edge)
326
+
- Example implementing browser-fallbacks: [examples/07 - CreateReactApp/eel_CRA.py](https://github.com/ChrisKnott/Eel/tree/master/examples/07%20-%20CreateReactApp/eel_CRA.py)
0 commit comments