Merge branch 'Carpetsmoker-3rd-party-cookies'
This commit is contained in:
commit
839d2b1cbe
@ -51,6 +51,7 @@ Changed
|
|||||||
- `:hint tab` and `F` now respect the `background-tabs` setting. To enforce a foreground tab (what `F` did before), use `:hint tab-fg` or `;f`.
|
- `:hint tab` and `F` now respect the `background-tabs` setting. To enforce a foreground tab (what `F` did before), use `:hint tab-fg` or `;f`.
|
||||||
- `:scroll` now takes a direction argument (`up`/`down`/`left`/`right`/`top`/`bottom`/`page-up`/`page-down`) instead of two pixel arguments (`dx`/`dy`). The old form still works but is deprecated.
|
- `:scroll` now takes a direction argument (`up`/`down`/`left`/`right`/`top`/`bottom`/`page-up`/`page-down`) instead of two pixel arguments (`dx`/`dy`). The old form still works but is deprecated.
|
||||||
- The `ui -> user-stylesheet` setting now also takes file paths relative to the config directory.
|
- The `ui -> user-stylesheet` setting now also takes file paths relative to the config directory.
|
||||||
|
- The `content -> cookies-accept` setting now has new `no-3rdparty` (default) and `no-unknown-3rdparty` values to block third-party cookies. The `default` value got renamed to `all`.
|
||||||
|
|
||||||
Deprecated
|
Deprecated
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
|
@ -149,7 +149,7 @@
|
|||||||
|<<content-ignore-javascript-alert,ignore-javascript-alert>>|Whether all javascript alerts should be ignored.
|
|<<content-ignore-javascript-alert,ignore-javascript-alert>>|Whether all javascript alerts should be ignored.
|
||||||
|<<content-local-content-can-access-remote-urls,local-content-can-access-remote-urls>>|Whether locally loaded documents are allowed to access remote urls.
|
|<<content-local-content-can-access-remote-urls,local-content-can-access-remote-urls>>|Whether locally loaded documents are allowed to access remote urls.
|
||||||
|<<content-local-content-can-access-file-urls,local-content-can-access-file-urls>>|Whether locally loaded documents are allowed to access other local urls.
|
|<<content-local-content-can-access-file-urls,local-content-can-access-file-urls>>|Whether locally loaded documents are allowed to access other local urls.
|
||||||
|<<content-cookies-accept,cookies-accept>>|Whether to accept cookies.
|
|<<content-cookies-accept,cookies-accept>>|Control which cookies to accept.
|
||||||
|<<content-cookies-store,cookies-store>>|Whether to store cookies.
|
|<<content-cookies-store,cookies-store>>|Whether to store cookies.
|
||||||
|<<content-host-block-lists,host-block-lists>>|List of URLs of lists which contain hosts to block.
|
|<<content-host-block-lists,host-block-lists>>|List of URLs of lists which contain hosts to block.
|
||||||
|<<content-host-blocking-enabled,host-blocking-enabled>>|Whether host blocking is enabled.
|
|<<content-host-blocking-enabled,host-blocking-enabled>>|Whether host blocking is enabled.
|
||||||
@ -1316,14 +1316,16 @@ Default: +pass:[true]+
|
|||||||
|
|
||||||
[[content-cookies-accept]]
|
[[content-cookies-accept]]
|
||||||
=== cookies-accept
|
=== cookies-accept
|
||||||
Whether to accept cookies.
|
Control which cookies to accept.
|
||||||
|
|
||||||
Valid values:
|
Valid values:
|
||||||
|
|
||||||
* +default+: Default QtWebKit behavior.
|
* +all+: Accept all cookies.
|
||||||
|
* +no-3rdparty+: Accept cookies from the same origin only.
|
||||||
|
* +no-unknown-3rdparty+: Accept cookies from the same origin only, unless a cookie is already set for the domain.
|
||||||
* +never+: Don't accept cookies at all.
|
* +never+: Don't accept cookies at all.
|
||||||
|
|
||||||
Default: +pass:[default]+
|
Default: +pass:[no-3rdparty]+
|
||||||
|
|
||||||
[[content-cookies-store]]
|
[[content-cookies-store]]
|
||||||
=== cookies-store
|
=== cookies-store
|
||||||
|
@ -328,6 +328,8 @@ class ConfigManager(QObject):
|
|||||||
('colors', 'completion.item.bg'),
|
('colors', 'completion.item.bg'),
|
||||||
]
|
]
|
||||||
CHANGED_OPTIONS = {
|
CHANGED_OPTIONS = {
|
||||||
|
('content', 'cookies-accept'):
|
||||||
|
_get_value_transformer('default', 'no-3rdparty'),
|
||||||
}
|
}
|
||||||
|
|
||||||
changed = pyqtSignal(str, str)
|
changed = pyqtSignal(str, str)
|
||||||
|
@ -675,8 +675,8 @@ def data(readonly=False):
|
|||||||
"local urls."),
|
"local urls."),
|
||||||
|
|
||||||
('cookies-accept',
|
('cookies-accept',
|
||||||
SettingValue(typ.AcceptCookies(), 'default'),
|
SettingValue(typ.AcceptCookies(), 'no-3rdparty'),
|
||||||
"Whether to accept cookies."),
|
"Control which cookies to accept."),
|
||||||
|
|
||||||
('cookies-store',
|
('cookies-store',
|
||||||
SettingValue(typ.Bool(), 'true'),
|
SettingValue(typ.Bool(), 'true'),
|
||||||
|
@ -1337,9 +1337,14 @@ class LastClose(BaseType):
|
|||||||
|
|
||||||
class AcceptCookies(BaseType):
|
class AcceptCookies(BaseType):
|
||||||
|
|
||||||
"""Whether to accept a cookie."""
|
"""Control which cookies to accept."""
|
||||||
|
|
||||||
valid_values = ValidValues(('default', "Default QtWebKit behavior."),
|
valid_values = ValidValues(('all', "Accept all cookies."),
|
||||||
|
('no-3rdparty', "Accept cookies from the same"
|
||||||
|
" origin only."),
|
||||||
|
('no-unknown-3rdparty', "Accept cookies from "
|
||||||
|
"the same origin only, unless a cookie is "
|
||||||
|
"already set for the domain."),
|
||||||
('never', "Don't accept cookies at all."))
|
('never', "Don't accept cookies at all."))
|
||||||
|
|
||||||
|
|
||||||
|
@ -238,6 +238,25 @@ class GlobalSetter(Setter):
|
|||||||
self._setter(*args)
|
self._setter(*args)
|
||||||
|
|
||||||
|
|
||||||
|
class CookiePolicy(Base):
|
||||||
|
|
||||||
|
"""The ThirdPartyCookiePolicy setting is different from other settings."""
|
||||||
|
|
||||||
|
MAPPING = {
|
||||||
|
'all': QWebSettings.AlwaysAllowThirdPartyCookies,
|
||||||
|
'no-3rdparty': QWebSettings.AlwaysBlockThirdPartyCookies,
|
||||||
|
'never': QWebSettings.AlwaysBlockThirdPartyCookies,
|
||||||
|
'no-unknown-3rdparty': QWebSettings.AllowThirdPartyWithExistingCookies,
|
||||||
|
}
|
||||||
|
|
||||||
|
def get(self, qws=None):
|
||||||
|
return config.get('content', 'cookies-accept')
|
||||||
|
|
||||||
|
def _set(self, value, qws=None):
|
||||||
|
QWebSettings.globalSettings().setThirdPartyCookiePolicy(
|
||||||
|
self.MAPPING[value])
|
||||||
|
|
||||||
|
|
||||||
MAPPINGS = {
|
MAPPINGS = {
|
||||||
'content': {
|
'content': {
|
||||||
'allow-images':
|
'allow-images':
|
||||||
@ -264,6 +283,8 @@ MAPPINGS = {
|
|||||||
Attribute(QWebSettings.LocalContentCanAccessRemoteUrls),
|
Attribute(QWebSettings.LocalContentCanAccessRemoteUrls),
|
||||||
'local-content-can-access-file-urls':
|
'local-content-can-access-file-urls':
|
||||||
Attribute(QWebSettings.LocalContentCanAccessFileUrls),
|
Attribute(QWebSettings.LocalContentCanAccessFileUrls),
|
||||||
|
'cookies-accept':
|
||||||
|
CookiePolicy(),
|
||||||
},
|
},
|
||||||
'network': {
|
'network': {
|
||||||
'dns-prefetch':
|
'dns-prefetch':
|
||||||
|
Loading…
Reference in New Issue
Block a user