Skip to content

fix: views:// URLs without folders fail to load#339

Open
AhmedNAgy25 wants to merge 1 commit intoblackboardsh:mainfrom
AhmedNAgy25:fix/views-url-trailing-slash
Open

fix: views:// URLs without folders fail to load#339
AhmedNAgy25 wants to merge 1 commit intoblackboardsh:mainfrom
AhmedNAgy25:fix/views-url-trailing-slash

Conversation

@AhmedNAgy25
Copy link
Copy Markdown

When setting up a view directly in the views folder (e.g. views://home.html) instead of a subfolder, the HTML file fails to load.

The error log shows:

ERROR: Could not open views file: .../views/home.html/

Looks like WebView2 adds a trailing slash when normalizing URLs without a path component, so it tries to load home.html/ as a folder instead of a file.

Fixed by stripping trailing slashes from the path before attempting to load the file. This affects path handling on all three platforms.

Fixes #329

When using views:// URLs without folder components (e.g., views://home.html),
WebView/WebView2 normalizes the URL by adding a trailing slash, resulting
in views://home.html/. This caused file loading to fail.

Fixes blackboardsh#329
@AhmedNAgy25
Copy link
Copy Markdown
Author

can any maintainer give a look here please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Setting up a view without a folder fails to load the html file

1 participant