Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for open a url #714

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion eel/browsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def _build_url_from_string(page: str, options: OptionsDictT) -> str:
if not isinstance(options['port'], (int, str)):
raise TypeError("'port' option must be an integer")
base_url = 'http://%s:%d/' % (options['host'], int(options['port']))
return base_url + page
if "http" in page:
return page
else:
return base_url + page


def _build_urls(start_pages: Iterable[Union[str, Dict[str, str]]], options: OptionsDictT) -> List[str]:
Expand Down
2 changes: 1 addition & 1 deletion eel/eel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
eel = {
_host: window.location.origin,
_host: new URL(document.currentScript.src).origin,

set_host: function (hostname) {
eel._host = hostname
Expand Down
1 change: 1 addition & 0 deletions examples/07 - CreateReactApp/eel_CRA.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def start_eel(develop):
host='localhost',
port=8080,
size=(1280, 800),
shutdown_delay=60 # Prevent disconnect when webpack hot refresh
)
try:
eel.start(page, mode=app, **eel_kwargs)
Expand Down