Skip to content
This repository was archived by the owner on Jun 22, 2025. It is now read-only.
Draft
Changes from 4 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
15 changes: 9 additions & 6 deletions eel/edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,28 @@
import sys
from typing import List

from eel.types import OptionsDictT
name = "Edge"

name: str = "Edge"


def run(path: str, options: OptionsDictT, start_urls: List[str]) -> None:
def run(path, options, start_urls):
if path != "edge_legacy":
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would propose passing back the string 'start microsoft-edge' from _find_edge_win(). For two reasons:

  1. This ensures that what is returned by _find_edge_win() is always executable in principle if it is not None.
  2. Users may locally introduce an alias for a binary, e.g. when they have several browser versions running, that they might reasonably call edge_legacy, so that any errors (even if unlikely) caused by a name conflict on the system would be untraceable.

if options["app_mode"]:
for url in start_urls:
sps.Popen([path, "--app=%s" % url] + options["cmdline_args"], stdout=sps.PIPE, stderr=sps.PIPE, stdin=sps.PIPE)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency I'd suggest you break the long lines here for the calls to sps.Popen here and below, similar to how they are implemented in chrome.py?

else:
args = options["cmdline_args"] + start_urls
sps.Popen([path, "--new-window"] + args, stdout=sps.PIPE, stderr=sps.PIPE, stdin=sps.PIPE)
sps.Popen(
[path, "--new-window"] + args,
stdout=sps.PIPE,
stderr=sps.PIPE,
stdin=sps.PIPE,
)
else:
cmd = "start microsoft-edge:{}".format(start_urls[0])
sps.Popen(cmd, stdout=sps.PIPE, stderr=sps.PIPE, stdin=sps.PIPE, shell=True)


def find_path() -> bool:
def find_path():
if sys.platform in ["win32", "win64"]:
return _find_edge_win()
else:
Expand Down