[GH-ISSUE #99] Add "no browser" commandline switch #94

Closed
opened 2026-02-26 12:20:28 +03:00 by kerem · 7 comments
Owner

Originally created by @ganego on GitHub (Jun 2, 2020).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/99

Originally assigned to: @brentvollebregt on GitHub.

Please add -nb (or so), to not run any browser. Then output in console via print() the correct address the program is listening on, for example http://localhost:3826/main.html so that it can be copy/pasted.

Reason:

  • I do not want to run some outdated Chrome that then phones home (I have on my disk for very rare occasions where I'd need it).
  • I use several different FF profiles (some of them in different Windows user contexts) and I do not want just a random instance open the link -> I need the URL so that I can copy/paste it to the correct browser.

Thank you.

Originally created by @ganego on GitHub (Jun 2, 2020). Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/99 Originally assigned to: @brentvollebregt on GitHub. Please add `-nb` (or so), to not run any browser. Then output in console via print() the correct address the program is listening on, for example `http://localhost:3826/main.html` so that it can be copy/pasted. Reason: - I do not want to run some outdated Chrome that then phones home (I have on my disk for very rare occasions where I'd need it). - I use several different FF profiles (some of them in different Windows user contexts) and I do not want just a random instance open the link -> I need the URL so that I can copy/paste it to the correct browser. Thank you.
kerem 2026-02-26 12:20:28 +03:00
Author
Owner

@brentvollebregt commented on GitHub (Jun 3, 2020):

I have added created a branch named feature/add-an-argument-to-stop-a-browser-from-opening. The new option proposed is --no-ui; is this what you're looking for?

<!-- gh-comment-id:637970044 --> @brentvollebregt commented on GitHub (Jun 3, 2020): I have added created a branch named [feature/add-an-argument-to-stop-a-browser-from-opening](https://github.com/brentvollebregt/auto-py-to-exe/tree/feature/add-an-argument-to-stop-a-browser-from-opening). The new option proposed is `--no-ui`; is this what you're looking for?
Author
Owner

@ganego commented on GitHub (Jun 3, 2020):

Thank you, seems to do what it should.
It should also print the index.html. Because just localhost:port won't connect since the server seems to have no auto-redirect to index.html (or make it auto-redirect).

I found some (not really important) bug: When you are on the web interface, press F5 several times quickly. The program will crash. Debug logging won't show anything and also no python error getting printed.

<!-- gh-comment-id:638038407 --> @ganego commented on GitHub (Jun 3, 2020): Thank you, seems to do what it should. It should also print the `index.html`. Because just localhost:port won't connect since the server seems to have no auto-redirect to index.html (or make it auto-redirect). I found some (not really important) bug: When you are on the web interface, press F5 several times quickly. The program will crash. Debug logging won't show anything and also no python error getting printed.
Author
Owner

@brentvollebregt commented on GitHub (Jun 3, 2020):

Looks like I had some uncommitted changes in my working directory, they are now committed.

When pressing F5 several times quickly, the program ends. This is because Eel has noticed that all the connections have disconnected and the program can now exit as the server does not need to be running any longer; this is the framework.

<!-- gh-comment-id:638079779 --> @brentvollebregt commented on GitHub (Jun 3, 2020): Looks like I had some uncommitted changes in my working directory, they are now committed. When pressing F5 several times quickly, the program ends. This is because Eel has noticed that all the connections have disconnected and the program can now exit as the server does not need to be running any longer; this is the framework.
Author
Owner

@ganego commented on GitHub (Jun 3, 2020):

Works. Thank you.

<!-- gh-comment-id:638085457 --> @ganego commented on GitHub (Jun 3, 2020): Works. Thank you.
Author
Owner

@brentvollebregt commented on GitHub (Jun 3, 2020):

Sweet, I'll merge it into master tomorrow when I get time 👍 ; I'm not by a computer at the moment.

<!-- gh-comment-id:638097573 --> @brentvollebregt commented on GitHub (Jun 3, 2020): Sweet, I'll merge it into master tomorrow when I get time 👍 ; I'm not by a computer at the moment.
Author
Owner

@brentvollebregt commented on GitHub (Jun 3, 2020):

In terms of the f5 issue, I have looked at Eel's documentation again and saw there is a close_callback argument that can be passed to eel.start which takes:

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

The current implementation for this option shows that if we pass a function that does nothing, it will not stop the server. For this --no-ui option, I believe it will be more useful if the server does not stop; so I'll add this in before merge.

<!-- gh-comment-id:638428429 --> @brentvollebregt commented on GitHub (Jun 3, 2020): In terms of the f5 issue, I have looked at Eel's documentation again and saw there is a `close_callback` argument that can be passed to `eel.start` which takes: >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 The [current implementation](https://github.com/samuelhwilliams/Eel/blob/master/eel/__init__.py#L330) for this option shows that if we pass a function that does nothing, it will not stop the server. For this `--no-ui` option, I believe it will be more useful if the server does not stop; so I'll add this in before merge.
Author
Owner

@brentvollebregt commented on GitHub (Jun 3, 2020):

I've fast-forwarded develop onto that branch, bumped the version and it is now getting ready to be deployed; should be on PyPI in less than 10min.

Cheers for the feature request and quick testing. The changes for this feature can be found in a1966fa and are available in v2.7.4.

<!-- gh-comment-id:638433555 --> @brentvollebregt commented on GitHub (Jun 3, 2020): I've fast-forwarded develop onto that branch, bumped the version and it is now getting ready to be deployed; should be on PyPI in less than 10min. Cheers for the feature request and quick testing. The changes for this feature can be found in a1966fa and are available in `v2.7.4`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/auto-py-to-exe#94
No description provided.