+
+ {homepageError && (
+
+ Please enter a valid homepage URL (http, https, or file).
+
+ )}
+
+ Opened by the Home button and when Responsively starts.
+
+
diff --git a/desktop-app/src/renderer/components/ToolBar/NavigationControls.tsx b/desktop-app/src/renderer/components/ToolBar/NavigationControls.tsx
index 6c65d0464..d2cfd3aec 100644
--- a/desktop-app/src/renderer/components/ToolBar/NavigationControls.tsx
+++ b/desktop-app/src/renderer/components/ToolBar/NavigationControls.tsx
@@ -10,6 +10,7 @@ export const NAVIGATION_EVENTS = {
BACK: 'back',
FORWARD: 'forward',
RELOAD: 'reload',
+ HOME: 'home',
};
interface NavigationItemProps {
diff --git a/desktop-app/src/renderer/lib/homepage.ts b/desktop-app/src/renderer/lib/homepage.ts
new file mode 100644
index 000000000..2daf5fcdc
--- /dev/null
+++ b/desktop-app/src/renderer/lib/homepage.ts
@@ -0,0 +1,19 @@
+export const DEFAULT_HOMEPAGE = 'https://www.google.com/';
+
+export const normalizeHomepage = (value: string): string | null => {
+ const address = value.trim();
+ if (!address) return null;
+
+ const isLocal = /^(localhost|127\.0\.0\.1|\[::1\])([:/?#]|$)/i.test(address);
+ const hasScheme = /^[a-z][a-z\d+.-]*:/i.test(address);
+ const isHostWithPort = /^(localhost|[^/?#:\s]+\.[^/?#:\s]+):\d+([/?#]|$)/i.test(address);
+ const url = hasScheme && !isHostWithPort ? address : `${isLocal ? 'http' : 'https'}://${address}`;
+
+ try {
+ const parsed = new URL(url);
+ if (!['http:', 'https:', 'file:'].includes(parsed.protocol)) return null;
+ return parsed.href;
+ } catch {
+ return null;
+ }
+};