Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PIM Messagelib
Commits
2ffcd62f
Commit
2ffcd62f
authored
Apr 06, 2021
by
Laurent Montel
Browse files
Allow to disable interceptor
parent
1a302345
Pipeline
#56628
passed with stage
in 42 minutes and 22 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
webengineviewer/src/urlinterceptor/blockexternalresourcesurlinterceptor/blockexternalresourcesurlinterceptor.cpp
View file @
2ffcd62f
...
...
@@ -16,10 +16,18 @@ BlockExternalResourcesUrlInterceptor::~BlockExternalResourcesUrlInterceptor()
{
}
void
BlockExternalResourcesUrlInterceptor
::
setEnabled
(
bool
enabled
)
{
mEnabled
=
enabled
;
}
bool
BlockExternalResourcesUrlInterceptor
::
interceptRequest
(
const
QUrl
&
url
,
QWebEngineUrlRequestInfo
::
ResourceType
resourceType
,
QWebEngineUrlRequestInfo
::
NavigationType
navigationType
)
{
if
(
!
mEnabled
)
{
return
false
;
}
const
QString
scheme
=
url
.
scheme
();
if
(
scheme
==
QLatin1String
(
"data"
)
||
scheme
==
QLatin1String
(
"file"
))
{
return
false
;
...
...
webengineviewer/src/urlinterceptor/blockexternalresourcesurlinterceptor/blockexternalresourcesurlinterceptor.h
View file @
2ffcd62f
...
...
@@ -22,7 +22,11 @@ public:
// Used by autotest only
Q_REQUIRED_RESULT
bool
interceptRequest
(
const
QUrl
&
url
,
QWebEngineUrlRequestInfo
::
ResourceType
resourceType
,
QWebEngineUrlRequestInfo
::
NavigationType
navigationType
);
void
setEnabled
(
bool
enabled
);
Q_SIGNALS:
void
formSubmittedForbidden
();
private:
bool
mEnabled
=
true
;
};
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment