Skip to content

Commit

Permalink
Fix Qt5.15.x behavior-change breakage
Browse files Browse the repository at this point in the history
  • Loading branch information
dougmassay committed Jun 6, 2020
1 parent f4cd043 commit 50280fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MainUI/MainWindow.cpp
Expand Up @@ -4289,7 +4289,7 @@ void MainWindow::ReadSettings()
web_settings->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, false);
web_settings->setAttribute(QWebEngineSettings::JavascriptCanAccessClipboard, false);
web_settings->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, (settings.remoteOn() == 1));
web_settings->setAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls, false);
web_settings->setAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls, true);
web_settings->setAttribute(QWebEngineSettings::PluginsEnabled, false);
web_settings->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, false);
web_settings->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, true);
Expand Down

2 comments on commit 50280fa

@kevinhendricks
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the record, Since urls with a file:/// scheme to access local files inside an epub should not exist, this change is actually needed to work around a bug first introduced by Qt 5.15!

See the two changes starting here:

https://github.com/qt/qtwebengine/blame/5.15.0/src/core/content_browser_client_qt.cpp#L1147

@dougmassay
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably drop the setting altogether, since 'true' is supposed to be the default, but changing a false to a true seemed like it might be an easier/quicker (more logical) patch in case anybody wanted to cherry-pick it.

You'd think one of these 100s of random behavior changes that Qt has inflicted on us would break our way occassionally! ;)

Please sign in to comment.