diff options
author | Yigit Akcay <yigit.akcay@qt.io> | 2023-02-02 15:21:45 +0100 |
---|---|---|
committer | Yigit Akcay <yigit.akcay@qt.io> | 2023-02-09 20:08:39 +0100 |
commit | c63afe36dbb20f515c8ddcb7565a317e56de6791 (patch) | |
tree | eaa49f411c8ea1ebc042f0683a4871033aae9712 /tests/auto/core/origins/resources/fetchApi.html | |
parent | 89d31abd8f7136c0d6b72705273836e668fda699 (diff) |
Custom URL Schemes usable with HTML5 Fetch Api
This change adds the QWebEngineUrlScheme::FetchApiAllowed flag and
test cases to test its effect.
When FetchApiAllowed flag is set a custom url scheme can be used by the
HTML5 fetch api.
Fixes: QTBUG-88830
Change-Id: I953dd0504bf508fd8082fae5db08b7b9fc47ea1f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'tests/auto/core/origins/resources/fetchApi.html')
-rw-r--r-- | tests/auto/core/origins/resources/fetchApi.html | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/core/origins/resources/fetchApi.html b/tests/auto/core/origins/resources/fetchApi.html new file mode 100644 index 000000000..7b54416fd --- /dev/null +++ b/tests/auto/core/origins/resources/fetchApi.html @@ -0,0 +1,14 @@ +<!doctype html> +<html> +<body> + <script type="text/javascript"> + const queryString = window.location.search; + const urlParams = new URLSearchParams(queryString); + const url = urlParams.get('url'); + const f = fetch(url); + if (urlParams.get('printRes') == 'true') { + f.then((r) => r.text()).then((p) => console.log(p)); + } + </script> +</body> +</html> |