mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
make cloud storage support optional
(currently not supported on FF-webext and MS Edge)
This commit is contained in:
parent
fff8e71ac0
commit
2e953b45c9
4 changed files with 25 additions and 13 deletions
|
|
@ -37,7 +37,9 @@ div > p:last-child {
|
||||||
input[type="number"] {
|
input[type="number"] {
|
||||||
width: 5em;
|
width: 5em;
|
||||||
}
|
}
|
||||||
|
input[type="checkbox"][disabled] + label {
|
||||||
|
opacity: 0.4;
|
||||||
|
}
|
||||||
.para {
|
.para {
|
||||||
width: 40em;
|
width: 40em;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -648,16 +648,18 @@ vAPI.messaging.listen('elementPicker', onMessage);
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
var µb = µBlock;
|
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
var onMessage = function(request, sender, callback) {
|
var onMessage = function(request, sender, callback) {
|
||||||
|
// Cloud storage support is optional.
|
||||||
|
if ( vAPI.cloud instanceof Object === false ) {
|
||||||
|
callback();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Async
|
// Async
|
||||||
switch ( request.what ) {
|
switch ( request.what ) {
|
||||||
case 'cloudGetOptions':
|
case 'cloudGetOptions':
|
||||||
vAPI.cloud.getOptions(function(options) {
|
vAPI.cloud.getOptions(function(options) {
|
||||||
options.enabled = µb.userSettings.cloudStorageEnabled === true;
|
options.enabled = µBlock.userSettings.cloudStorageEnabled === true;
|
||||||
callback(options);
|
callback(options);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|
@ -722,7 +724,8 @@ var getLocalData = function(callback) {
|
||||||
lastRestoreFile: o.lastRestoreFile,
|
lastRestoreFile: o.lastRestoreFile,
|
||||||
lastRestoreTime: o.lastRestoreTime,
|
lastRestoreTime: o.lastRestoreTime,
|
||||||
lastBackupFile: o.lastBackupFile,
|
lastBackupFile: o.lastBackupFile,
|
||||||
lastBackupTime: o.lastBackupTime
|
lastBackupTime: o.lastBackupTime,
|
||||||
|
cloudStorageSupported: vAPI.cloud instanceof Object
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,10 @@ var onLocalDataReceived = function(details) {
|
||||||
uDom('#localData > ul > li:nth-of-type(3) > ul > li:nth-of-type(2)').text(lastRestoreFile);
|
uDom('#localData > ul > li:nth-of-type(3) > ul > li:nth-of-type(2)').text(lastRestoreFile);
|
||||||
uDom('#localData > ul > li:nth-of-type(3)').css('display', '');
|
uDom('#localData > ul > li:nth-of-type(3)').css('display', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( details.cloudStorageSupported === false ) {
|
||||||
|
uDom('#cloud-storage-enabled').attr('disabled', '');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
|
||||||
|
|
@ -67,12 +67,15 @@ var onAllReady = function() {
|
||||||
// for launch time.
|
// for launch time.
|
||||||
µb.assets.remoteFetchBarrier -= 1;
|
µb.assets.remoteFetchBarrier -= 1;
|
||||||
|
|
||||||
vAPI.cloud.start([
|
// vAPI.cloud is optional.
|
||||||
'tpFiltersPane',
|
if ( vAPI.cloud instanceof Object ) {
|
||||||
'myFiltersPane',
|
vAPI.cloud.start([
|
||||||
'myRulesPane',
|
'tpFiltersPane',
|
||||||
'whitelistPane'
|
'myFiltersPane',
|
||||||
]);
|
'myRulesPane',
|
||||||
|
'whitelistPane'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
//quickProfiler.stop(0);
|
//quickProfiler.stop(0);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue