Skip to content

Commit

Permalink
fix(browser): handle blob URL scheme for Qt older than 5.12
Browse files Browse the repository at this point in the history
Add a special check for blob: resources in URL request interceptor.

Fixes #1376.
  • Loading branch information
trollixx committed Sep 17, 2023
1 parent dcf6016 commit 9d376c2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libs/browser/urlrequestinterceptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ void UrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
const QUrl requestUrl = info.requestUrl();
const QUrl firstPartyUrl = info.firstPartyUrl();

#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
// Workaround for https://github.com/zealdocs/zeal/issues/1376. Fixed in Qt 5.12.0.
if (!firstPartyUrl.isValid() && requestUrl.scheme() == QLatin1String("blob")) {
return;
}
#endif

// Block invalid requests.
if (!requestUrl.isValid() || !firstPartyUrl.isValid()) {
blockRequest(info);
Expand Down

0 comments on commit 9d376c2

Please sign in to comment.