webui-dev / webui

Use any web browser or WebView as GUI, with your preferred language in the backend and modern web technologies in the frontend, all in a lightweight portable library.
https://webui.me
MIT License
2.9k stars 164 forks source link

Set custom browser data path #193

Closed fibodevy closed 11 months ago

fibodevy commented 1 year ago

All browser data is saved to HOME or USERPROFILE -> .WebUI. Currently 2 different WebUI apps share the same folder and the same settings - window size, position and possibly saved form data and passwords (didn't check that). It would be a nice feature to have the ability to set custom profile path.

hassandraga commented 1 year ago

Yeah, good idea, This will probably require a new API: webui_set_profile(const char* profileName, const char* profilePath)

hassandraga commented 11 months ago

Implemented https://github.com/webui-dev/webui/commit/a616991ca679f0646bf35d580443e101369273ce.

To set your custom profile:

webui_set_profile(
    myWindow, 
    "Bar", // Your profile name, usually needed for Firefox
    "/Home/Foo/Bar" // Your profile folder, usually needed for Chrome
);

To simply let WebUI use the user default profile:

webui_set_profile(myWindow, "", "");