mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-18 17:02:27 +02:00
Make the creation of _allow_ rules in panel an opt-in feature
There have been too many examples out there of users opting-in to "I am an advanced user" and yet still misusing dynamic filtering by creating _allow_ rules where _noop_ rules should be used. Creating _allow_ rules has serious consequences as these override blocking static filters and can potentially disable other advanced filtering ability such as HTML filtering and scriptlet injection -- often used to deal with anti-blocker mechanisms. The ability to point-and-click to create _allow_ rules from the popup panel is no longer allowed by default. An new advanced setting has been added to enable the ability to create _allow_ rules from the popup panel, `popupPanelGodMode`, which default to `false`. Set to `true` to restore ability to set _allow_ rules from popup panel. Since the creation of _allow_ rules is especially useful to filter list authors, to diagnose and narrow down site breakage as a result of problematic blocking filter, the creation of _allow_ rules will still be available when the advanced setting `filterAuthorMode` is `true`. This change is probably going to be problematic to all those users who were misusing dynamic filtering by creating _allow_ rules instead of _noop_ rules -- but the breakage is going to bring their misusing to their attention, a positive outcome.
This commit is contained in:
parent
7b140a139e
commit
162e537270
@ -478,7 +478,9 @@ body.advancedUser #firewall > div > span.noopRule.ownRule,
|
|||||||
|
|
||||||
#actionSelector {
|
#actionSelector {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
justify-items: stretch;
|
||||||
left: 0;
|
left: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -488,16 +490,17 @@ body.advancedUser #firewall > div > span.noopRule.ownRule,
|
|||||||
}
|
}
|
||||||
#actionSelector > span {
|
#actionSelector > span {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: 100%;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
#actionSelector > #dynaAllow {
|
#actionSelector > #dynaAllow {
|
||||||
width: 33%;
|
display: none;
|
||||||
|
}
|
||||||
|
body.godMode #actionSelector > #dynaAllow {
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
#actionSelector > #dynaNoop {
|
#actionSelector > #dynaNoop {
|
||||||
width: 33.5%;
|
|
||||||
}
|
}
|
||||||
#actionSelector > #dynaBlock {
|
#actionSelector > #dynaBlock {
|
||||||
width: 33.5%;
|
|
||||||
}
|
}
|
||||||
#actionSelector > #dynaCounts {
|
#actionSelector > #dynaCounts {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
@ -68,6 +68,7 @@ const µBlock = (( ) => { // jshint ignore:line
|
|||||||
popupFontSize: 'unset',
|
popupFontSize: 'unset',
|
||||||
popupPanelDisabledSections: 0,
|
popupPanelDisabledSections: 0,
|
||||||
popupPanelLockedSections: 0,
|
popupPanelLockedSections: 0,
|
||||||
|
popupPanelGodMode: false,
|
||||||
popupPanelHeightMode: 0,
|
popupPanelHeightMode: 0,
|
||||||
requestJournalProcessPeriod: 1000,
|
requestJournalProcessPeriod: 1000,
|
||||||
selfieAfter: 3,
|
selfieAfter: 3,
|
||||||
|
@ -269,6 +269,7 @@ const popupDataFromTabId = function(tabId, tabTitle) {
|
|||||||
const tabContext = µb.tabContextManager.mustLookup(tabId);
|
const tabContext = µb.tabContextManager.mustLookup(tabId);
|
||||||
const rootHostname = tabContext.rootHostname;
|
const rootHostname = tabContext.rootHostname;
|
||||||
const µbus = µb.userSettings;
|
const µbus = µb.userSettings;
|
||||||
|
const µbhs = µb.hiddenSettings;
|
||||||
const r = {
|
const r = {
|
||||||
advancedUserEnabled: µbus.advancedUserEnabled,
|
advancedUserEnabled: µbus.advancedUserEnabled,
|
||||||
appName: vAPI.app.name,
|
appName: vAPI.app.name,
|
||||||
@ -278,7 +279,8 @@ const popupDataFromTabId = function(tabId, tabTitle) {
|
|||||||
firewallPaneMinimized: µbus.firewallPaneMinimized,
|
firewallPaneMinimized: µbus.firewallPaneMinimized,
|
||||||
globalAllowedRequestCount: µb.localSettings.allowedRequestCount,
|
globalAllowedRequestCount: µb.localSettings.allowedRequestCount,
|
||||||
globalBlockedRequestCount: µb.localSettings.blockedRequestCount,
|
globalBlockedRequestCount: µb.localSettings.blockedRequestCount,
|
||||||
fontSize: µb.hiddenSettings.popupFontSize,
|
fontSize: µbhs.popupFontSize,
|
||||||
|
godMode: µbhs.filterAuthorMode || µbhs.popupPanelGodMode,
|
||||||
netFilteringSwitch: false,
|
netFilteringSwitch: false,
|
||||||
rawURL: tabContext.rawURL,
|
rawURL: tabContext.rawURL,
|
||||||
pageURL: tabContext.normalURL,
|
pageURL: tabContext.normalURL,
|
||||||
@ -288,16 +290,16 @@ const popupDataFromTabId = function(tabId, tabTitle) {
|
|||||||
pageBlockedRequestCount: 0,
|
pageBlockedRequestCount: 0,
|
||||||
popupBlockedCount: 0,
|
popupBlockedCount: 0,
|
||||||
popupPanelSections: µbus.popupPanelSections,
|
popupPanelSections: µbus.popupPanelSections,
|
||||||
popupPanelDisabledSections: µb.hiddenSettings.popupPanelDisabledSections,
|
popupPanelDisabledSections: µbhs.popupPanelDisabledSections,
|
||||||
popupPanelLockedSections: µb.hiddenSettings.popupPanelLockedSections,
|
popupPanelLockedSections: µbhs.popupPanelLockedSections,
|
||||||
popupPanelHeightMode: µb.hiddenSettings.popupPanelHeightMode,
|
popupPanelHeightMode: µbhs.popupPanelHeightMode,
|
||||||
tabId: tabId,
|
tabId: tabId,
|
||||||
tabTitle: tabTitle,
|
tabTitle: tabTitle,
|
||||||
tooltipsDisabled: µbus.tooltipsDisabled
|
tooltipsDisabled: µbus.tooltipsDisabled
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( µb.hiddenSettings.uiPopupConfig !== 'undocumented' ) {
|
if ( µbhs.uiPopupConfig !== 'undocumented' ) {
|
||||||
r.uiPopupConfig = µb.hiddenSettings.uiPopupConfig;
|
r.uiPopupConfig = µbhs.uiPopupConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
const pageStore = µb.pageStoreFromTabId(tabId);
|
const pageStore = µb.pageStoreFromTabId(tabId);
|
||||||
|
@ -644,6 +644,13 @@ let renderOnce = function() {
|
|||||||
if ( popupData.popupPanelHeightMode === 1 ) {
|
if ( popupData.popupPanelHeightMode === 1 ) {
|
||||||
body.classList.add('vMin');
|
body.classList.add('vMin');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prevent non-advanced user opting into advanced user mode from harming
|
||||||
|
// themselves by disabling by default features generally suitable to
|
||||||
|
// filter list maintainers and actual advanced users.
|
||||||
|
if ( popupData.godMode ) {
|
||||||
|
body.classList.add('godMode');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
Loading…
Reference in New Issue
Block a user