mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
Prevent access to picker when "My filters" is not enabled
Related issue: https://github.com/uBlockOrigin/uBlock-issues/issues/3076
This commit is contained in:
parent
a15c3564ef
commit
bc641fc024
@ -211,7 +211,7 @@ body.needSave #revertRules {
|
|||||||
font-size: 1.6em;
|
font-size: 1.6em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#basicTools:not(.canPick) .needPick {
|
#basicTools .needPick:not(.canPick) {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,6 +139,8 @@ vAPI.commands.onCommand.addListener(async command => {
|
|||||||
|
|
||||||
switch ( command ) {
|
switch ( command ) {
|
||||||
case 'launch-element-picker':
|
case 'launch-element-picker':
|
||||||
|
if ( µb.userFiltersAreEnabled() === false ) { break; }
|
||||||
|
/* fall through */
|
||||||
case 'launch-element-zapper': {
|
case 'launch-element-zapper': {
|
||||||
µb.epickerArgs.mouse = false;
|
µb.epickerArgs.mouse = false;
|
||||||
µb.elementPickerExec(
|
µb.elementPickerExec(
|
||||||
|
@ -200,7 +200,11 @@ let currentBits = 0;
|
|||||||
|
|
||||||
const update = function(tabId = undefined) {
|
const update = function(tabId = undefined) {
|
||||||
let newBits = 0;
|
let newBits = 0;
|
||||||
if ( µb.userSettings.contextMenuEnabled && tabId !== undefined ) {
|
if (
|
||||||
|
µb.userSettings.contextMenuEnabled &&
|
||||||
|
µb.userFiltersAreEnabled() &&
|
||||||
|
tabId !== undefined
|
||||||
|
) {
|
||||||
const pageStore = µb.pageStoreFromTabId(tabId);
|
const pageStore = µb.pageStoreFromTabId(tabId);
|
||||||
if ( pageStore && pageStore.getNetFilteringSwitch() ) {
|
if ( pageStore && pageStore.getNetFilteringSwitch() ) {
|
||||||
if ( pageStore.shouldApplySpecificCosmeticFilters(0) ) {
|
if ( pageStore.shouldApplySpecificCosmeticFilters(0) ) {
|
||||||
|
@ -369,6 +369,7 @@ const popupDataFromTabId = function(tabId, tabTitle) {
|
|||||||
fontSize: µbhs.popupFontSize,
|
fontSize: µbhs.popupFontSize,
|
||||||
godMode: µbhs.filterAuthorMode,
|
godMode: µbhs.filterAuthorMode,
|
||||||
netFilteringSwitch: false,
|
netFilteringSwitch: false,
|
||||||
|
userFiltersAreEnabled: µb.userFiltersAreEnabled(),
|
||||||
rawURL: tabContext.rawURL,
|
rawURL: tabContext.rawURL,
|
||||||
pageURL: tabContext.normalURL,
|
pageURL: tabContext.normalURL,
|
||||||
pageHostname: rootHostname,
|
pageHostname: rootHostname,
|
||||||
|
@ -614,11 +614,11 @@ const renderPopup = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dom.cl.toggle(
|
const canPick = popupData.canElementPicker && isFiltering;
|
||||||
'#basicTools',
|
|
||||||
'canPick',
|
dom.cl.toggle('#gotoZap', 'canPick', canPick);
|
||||||
popupData.canElementPicker === true && isFiltering
|
dom.cl.toggle('#gotoPick', 'canPick', canPick && popupData.userFiltersAreEnabled);
|
||||||
);
|
dom.cl.toggle('#gotoReport', 'canPick', canPick);
|
||||||
|
|
||||||
let blocked, total;
|
let blocked, total;
|
||||||
if ( popupData.pageCounts !== undefined ) {
|
if ( popupData.pageCounts !== undefined ) {
|
||||||
@ -675,7 +675,7 @@ const renderPopup = function() {
|
|||||||
total ? Math.min(total, 99).toLocaleString() : ''
|
total ? Math.min(total, 99).toLocaleString() : ''
|
||||||
);
|
);
|
||||||
|
|
||||||
// Unprocesseed request(s) warning
|
// Unprocessed request(s) warning
|
||||||
dom.cl.toggle(dom.root, 'warn', popupData.hasUnprocessedRequest === true);
|
dom.cl.toggle(dom.root, 'warn', popupData.hasUnprocessedRequest === true);
|
||||||
|
|
||||||
dom.cl.toggle(dom.html, 'colorBlind', popupData.colorBlindFriendly === true);
|
dom.cl.toggle(dom.html, 'colorBlind', popupData.colorBlindFriendly === true);
|
||||||
|
@ -628,6 +628,10 @@ onBroadcast(msg => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
µb.userFiltersAreEnabled = function() {
|
||||||
|
return this.selectedFilterLists.includes(this.userFiltersPath);
|
||||||
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
µb.autoSelectRegionalFilterLists = function(lists) {
|
µb.autoSelectRegionalFilterLists = function(lists) {
|
||||||
|
Loading…
Reference in New Issue
Block a user