summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYigit Akcay <yigit.akcay@qt.io>2023-02-02 15:21:45 +0100
committerYigit Akcay <yigit.akcay@qt.io>2023-02-09 20:08:39 +0100
commitc63afe36dbb20f515c8ddcb7565a317e56de6791 (patch)
treeeaa49f411c8ea1ebc042f0683a4871033aae9712 /src
parent89d31abd8f7136c0d6b72705273836e668fda699 (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 'src')
-rw-r--r--src/core/api/qwebengineurlscheme.cpp4
-rw-r--r--src/core/api/qwebengineurlscheme.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/core/api/qwebengineurlscheme.cpp b/src/core/api/qwebengineurlscheme.cpp
index 4af89c616..1ab32aaad 100644
--- a/src/core/api/qwebengineurlscheme.cpp
+++ b/src/core/api/qwebengineurlscheme.cpp
@@ -162,6 +162,10 @@ public:
this includes access from other schemes. The appropriate CORS headers are
generated automatically by the QWebEngineUrlRequestJob class. By default only
\c http and \c https are CORS enabled. (Added in Qt 5.14)
+
+ \value FetchApiAllowed
+ Enables a URL scheme to be used by the HTML5 fetch API. By default
+ only \c http and \c https can be used by fetch.
*/
QWebEngineUrlScheme::QWebEngineUrlScheme(QWebEngineUrlSchemePrivate *d) : d(d) {}
diff --git a/src/core/api/qwebengineurlscheme.h b/src/core/api/qwebengineurlscheme.h
index 5b6e088cf..35498a68e 100644
--- a/src/core/api/qwebengineurlscheme.h
+++ b/src/core/api/qwebengineurlscheme.h
@@ -42,6 +42,7 @@ public:
ViewSourceAllowed = 0x20,
ContentSecurityPolicyIgnored = 0x40,
CorsEnabled = 0x80,
+ FetchApiAllowed = 0x100,
};
Q_DECLARE_FLAGS(Flags, Flag)
Q_FLAG(Flags)