[WIP] Per site settings
Per site (domain) settings (configuration) of some features.
Have a default value for each option and use that if not set otherwise.
The idea is based on comment from ancient past: https://phabricator.kde.org/D12096#245496
The thing now is which features should be governed (supported) by this Falkon feature.
So far I only follow the idea from the ancient post. Have the JS, Images, Cookies, Zoom and HTML5 permissions.
The configuration for features which are easy to implement are the ones in QWebEngineSettings::WebAttribute enum.
The work can be divided into X sections:
-
HTML5 Permission -
WebAttribute QtWE features located in QWebEngineSettings::WebAttribute -
Zoom level - Skipping for initial release
-
Cookies -
Try to write an autotest of the core part -
Autotests for WebAttributes
-
-
Add migration code from old version to new system -
HTML5 permissions -
Cookies white/black lists
-
-
An inspection plugin to view the current website configuration - Needs to be updated as the whole feature is being worked on.
-
QML support -
Python support
This might require some nice design of a back-end which will be using SqLite database and some manager to manage it.
For front end (a.k.a. GUI) there needs to be modification and addition on multiple areas.
-
HTML5 Permission dialog -
Preferences dialogs -
SiteInfo window - Add all permissions in some form -
Cookies Manager GUI rewrite - Only the backend will be rewritten (it means that the result will be not great and should be improved in the future)
-
Some place to set defaults, at the moment the HTML5 permissions are set in html5 per. dialog and JS, Zoom, Cookies somewhere in the Falkon Preferences... - Default configuration for most of the options is kept at the original place.
- Only default values for HTML5 features are placed in a new location (since they did not exist before)
- New WebAttributes are placed into browsing section
Supported webAttributes
A list of features (options) from QWebEngineSettings to implement per site (domain, host). A crucial point is that these settings needs to be accepted by QtWebEngine at runtime after each page reload. (There are some which can be set only during the new tab creation.)
- AutoLoadImages
- JavascriptEnabled
- JavascriptCanOpenWindows
- JavascriptCanAccessClipboard
- JavascriptCanPaste
- AllowWindowActivationFromJavaScript
- LocalStorageEnabled
- FullScreenSupportEnabled
- AllowRunningInsecureContent
- AllowWindowActivationFromJavaScript
- PlaybackRequiresUserGesture
- ReadingFromCanvasEnabled (Qt 6.6+)
- ForceDarkMode (Qt 6.7+)
Private browsing
SKIPPING
Private browsing will use same global and per site settings as normal mode.
My idea about this is to have separate GLOBAL settings for private mode and maybe also for each site? But I do not intend to delete any records from database so it would be pointless, well will go only with GLOBAL mode.
Unless there are complains I will do it this way.
Conclusion
The work is being carried out in WIP_fb_site_settings_in_database branch and can be reviewed in MERGE reuest !40 (closed).
On top of that I am also just learning a lot of stuff on the go so the commits are a mess and will be squashed before merging.
All HELP is welcome.