-
Notifications
You must be signed in to change notification settings - Fork 261
Closed
Description
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:
Window myWindow = new_window();
if (webui_find_best_browser() == Firefox) {
// Set XPI file in extensions to load
} else if (webui_find_best_browser() == ChromiumBased) {
// Set ZIP or whatever Chromium uses I can't remember
} else {
// Do nothing? Attempt to load both and see which works? Idk, up to the developer
}
// Since `show()` internally also calls `webui_find_best_browser()`, this should match what was determined earlier UNLESS there is already a `current_browser` set internally (see: https://github.com/webui-dev/webui/blob/2a5f0c98fbb267a5aed921a8678f3f108bb12a6e/src/webui.c#L5272)
myWindow.show("<html>Hello World!</html>")Perhaps the function should also be renamed to something like webui_determine_browser or something, just to make it more clear.
Metadata
Metadata
Assignees
Labels
No labels