-
Notifications
You must be signed in to change notification settings - Fork 169
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
[Feature Request] Expose _webui_find_best_browser
#325
Comments
Now, there is a api for choosing browser Line 221 in 2a5f0c9
It will return whether the setting is successful, which can indeed achieve the effect you mentioned. |
Totally! I think that the API you linked covers 90% of cases, but it would be good to have something that allows devs to know before the browser launches, in case they need to do any specific preparations (preloading a browser specific library, showing a warning/message asking the user if they want to use the browser that was detected, etc.) |
Good point. We can probably create a new API like this: WEBUI_EXPORT size_t webui_get_best_browser(); size_t webui_get_best_browser() {
return _webui_find_best_browser();
} |
if (webui_get_best_browser() == Firefox) {
// Set XPI file in extensions to load
webui_show_browser(myWindow, HTML, Firefox);
} else if (webui_get_best_browser() == Chrome) {
// Set ZIP or whatever Chrome uses
webui_show_browser(myWindow, HTML, Chrome);
} else {
// ...
webui_show(myWindow, HTML);
} |
I feel as though there may be some conditional logic developers may want to do based on the browser to use, BEFORE the window is shown. An example of this would be conditionally loading a Firefox XPI or Chromium extension, depending on which browser will be used (assuming #307 implements the feature for both platforms).
I imagine it would look something like this:
Perhaps the function should also be renamed to something like
webui_determine_browser
or something, just to make it more clear.The text was updated successfully, but these errors were encountered: