mirror of https://github.com/gorhill/uBlock.git
Mind restore-from-backup for no-csp-reports rule
Related commit:
- 7d90f97aa1
This commit is contained in:
parent
2ddf6904f0
commit
a307cf5e6a
|
@ -926,6 +926,16 @@ const backupUserData = async function() {
|
|||
const restoreUserData = async function(request) {
|
||||
const userData = request.userData;
|
||||
|
||||
// https://github.com/LiCybora/NanoDefenderFirefox/issues/196
|
||||
// Backup data could be from Chromium platform or from an older
|
||||
// Firefox version.
|
||||
if (
|
||||
vAPI.webextFlavor.soup.has('firefox') &&
|
||||
vAPI.app.intFromVersion(userData.version) <= 1031003011
|
||||
) {
|
||||
userData.hostnameSwitchesString += '\nno-csp-reports: * true';
|
||||
}
|
||||
|
||||
// https://github.com/chrisaljoudi/uBlock/issues/1102
|
||||
// Ensure all currently cached assets are flushed from storage AND memory.
|
||||
µb.assets.rmrf();
|
||||
|
|
|
@ -114,8 +114,11 @@ const onVersionReady = function(lastVersion) {
|
|||
if ( lastVersionInt === 0 ) { return; }
|
||||
|
||||
// https://github.com/LiCybora/NanoDefenderFirefox/issues/196
|
||||
// Toggle on the blocking of CSP reports by default.
|
||||
if ( lastVersionInt <= 1031003011 ) {
|
||||
// Toggle on the blocking of CSP reports by default for Firefox.
|
||||
if (
|
||||
vAPI.webextFlavor.soup.has('firefox') &&
|
||||
lastVersionInt <= 1031003011
|
||||
) {
|
||||
µb.sessionSwitches.toggle('no-csp-reports', '*', 1);
|
||||
µb.permanentSwitches.toggle('no-csp-reports', '*', 1);
|
||||
µb.saveHostnameSwitches();
|
||||
|
|
Loading…
Reference in New Issue