From fe2129a04aaf0718c8326560038f5ef93208dc22 Mon Sep 17 00:00:00 2001 From: Curve Date: Mon, 2 Sep 2024 13:50:16 +0200 Subject: [PATCH] refactor(docs/schemes): add note on wv2 authority --- docs/advanced/schemes.mdx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/advanced/schemes.mdx b/docs/advanced/schemes.mdx index 455fadd..43d5d92 100644 --- a/docs/advanced/schemes.mdx +++ b/docs/advanced/schemes.mdx @@ -51,7 +51,7 @@ int main() }; }); - smartview.set_url("demo://index.html"); + smartview.set_url("demo://data/index.html"); // green-end smartview.show(); @@ -61,6 +61,20 @@ int main() } ``` +:::caution +Due to upstream issues with the JS-Fetch API on WebView2, it is required to specify an authority for all scheme-urls. +If none is specified, the given file will be treated as the authority, which may lead to unexpected results. + +```cpp title="Example: Add Authority" +// red +smartview.set_url("demo://index.html"); +// green +smartview.set_url("demo://root/index.html"); // "root" can be any text +``` + +It is recommended to always add an authority to your custom-scheme url due to this issue. +::: + As you can see, the response consists of some `data` and the `mime`-type. Headers and the status-code can also be optionally specified. ## Stash