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

Improuvments #1

Open
AlbertShown opened this issue May 24, 2024 · 2 comments
Open

Improuvments #1

AlbertShown opened this issue May 24, 2024 · 2 comments

Comments

@AlbertShown
Copy link

I wonder if it will be better to use const instead of numbers.

Change win.showBrowser("index.html", 2) to win.showBrowser("index.html", webui.Chrome).

webui.NoBrowser,  // 0. No web browser
webui.AnyBrowser, // 1. Default recommended web browser
webui.Chrome, // 2. Google Chrome
webui.Firefox, // 3. Mozilla Firefox
webui.Edge, // 4. Microsoft Edge
webui.Safari, // 5. Apple Safari
webui.Chromium, // 6. The Chromium Project
webui.Opera, // 7. Opera Browser
webui.Brave, // 8. The Brave Browser
webui.Vivaldi, // 9. The Vivaldi Browser
webui.Epic, // 10. The Epic Browser
webui.Yandex, // 11. The Yandex Browser
webui.ChromiumBased, // 12. Any Chromium based browser
@AlbertShown
Copy link
Author

Also, I guess this will be good to have:

if (e.eventType == webui.WindowConnection) { ... }

webui.WindowDisconnection // 0: Window disconnection event
webui.WindowConnection // 1: Window connection event
webui.MouseClick // 2: Mouse click event
webui.WindowNavigation // 3: Window navigation event
webui.FunctionCall // 4: Function call event

@xland
Copy link
Owner

xland commented May 25, 2024

Thank you for your suggestion.

I know what you mean.
I also considered the solution you suggested,when I was writing this part of the code.

If I provide such a const type or enum type to the user(TypeScript Developer).
The user must import the definition files of these types, when they using these types.
This will complicate my distribution package.

Maybe you have a better way to solve this problem.
PR is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants