Skip to content

Commit

Permalink
refactor(docs/schemes): add note on wv2 authority
Browse files Browse the repository at this point in the history
  • Loading branch information
Curve committed Sep 2, 2024
1 parent 000308d commit fe2129a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docs/advanced/schemes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int main()
};
});

smartview.set_url("demo://index.html");
smartview.set_url("demo://data/index.html");
// green-end

smartview.show();
Expand All @@ -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
Expand Down

0 comments on commit fe2129a

Please sign in to comment.