Most servers are configured to automatically return the index.html file located in the root directory when you access the root path (/). This means that both accessing / and index.html in a browser will result in receiving the text content of index.html. The browser then parses and renders this HTML.
Although the HTTP responses they receive are identical (both contain the text content of index.html), they have different implications for the frontend. This relates to the concept of frontend routing in modern responsive frameworks like Vue and React. For the following two URLs: http://192.168.254.1:8080/index.html and http://192.168.254.1:8080/, the frontend code interprets these as two distinct route addresses. Typically, frontend routing frameworks such as vue-router only recognize the / route and do not recognize the index.html route. Therefore, when you access index.html, it cannot route to the correct component, resulting in a blank screen because it fails to display anything.
In webviewtwo, we can only do win.Navigate("index.html"). If we do win.Navigate("/"), it will prompt "Unable to access this page. The webpage at https://ahk.localhost/ seems to be having problems." However, when we visit win.Navigate("index.html"), a blank screen appears because the routing is not correct.
One solution is to configure route redirection in the frontend web project, redirecting from index.html to / when accessed. Although this implementation allows for normal display, pressing F5 to refresh still causes issues.
Most servers are configured to automatically return the index.html file located in the root directory when you access the root path (/). This means that both accessing / and index.html in a browser will result in receiving the text content of index.html. The browser then parses and renders this HTML.
Although the HTTP responses they receive are identical (both contain the text content of index.html), they have different implications for the frontend. This relates to the concept of frontend routing in modern responsive frameworks like Vue and React. For the following two URLs: http://192.168.254.1:8080/index.html and http://192.168.254.1:8080/, the frontend code interprets these as two distinct route addresses. Typically, frontend routing frameworks such as vue-router only recognize the / route and do not recognize the index.html route. Therefore, when you access index.html, it cannot route to the correct component, resulting in a blank screen because it fails to display anything.
In webviewtwo, we can only do win.Navigate("index.html"). If we do win.Navigate("/"), it will prompt "Unable to access this page. The webpage at https://ahk.localhost/ seems to be having problems." However, when we visit win.Navigate("index.html"), a blank screen appears because the routing is not correct.
One solution is to configure route redirection in the frontend web project, redirecting from index.html to / when accessed. Although this implementation allows for normal display, pressing F5 to refresh still causes issues.