diff --git a/src/Browser/Main/WebView.php b/src/Browser/Main/WebView.php index 086adaf..e388942 100644 --- a/src/Browser/Main/WebView.php +++ b/src/Browser/Main/WebView.php @@ -28,15 +28,20 @@ public function onRequest(WebViewRequest $request): void { assert($this->app instanceof App); + $uri = $request->getUri(); + $parsed = parse_url($uri); + $body = str_replace( [ - '{{ scheme }}', '{{ uri }}', + '{{ scheme }}', + '{{ host }}', '{{ path }}', ], [ - $request->getScheme(), - $request->getUri(), - $request->getPath(), + $uri, + $parsed['scheme'] ?? '', + $parsed['host'] ?? '', + $parsed['path'] ?? '', ], $this->app->customHtml ); diff --git a/static/html/browser_custom.html b/static/html/browser_custom.html index 301c3bd..d788bab 100644 --- a/static/html/browser_custom.html +++ b/static/html/browser_custom.html @@ -16,8 +16,9 @@