mirror of https://github.com/gorhill/uBlock.git
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 {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
height: 100%;
|
||||
justify-items: stretch;
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
|
@ -488,16 +490,17 @@ body.advancedUser #firewall > div > span.noopRule.ownRule,
|
|||
}
|
||||
#actionSelector > span {
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
flex-grow: 1;
|
||||
}
|
||||
#actionSelector > #dynaAllow {
|
||||
width: 33%;
|
||||
display: none;
|
||||
}
|
||||
body.godMode #actionSelector > #dynaAllow {
|
||||
display: inline-block;
|
||||
}
|
||||
#actionSelector > #dynaNoop {
|
||||
width: 33.5%;
|
||||
}
|
||||
#actionSelector > #dynaBlock {
|
||||
width: 33.5%;
|
||||
}
|
||||
#actionSelector > #dynaCounts {
|
||||
background-color: transparent;
|
||||
|
|
|
@ -68,6 +68,7 @@ const µBlock = (( ) => { // jshint ignore:line
|
|||
popupFontSize: 'unset',
|
||||
popupPanelDisabledSections: 0,
|
||||
popupPanelLockedSections: 0,
|
||||
popupPanelGodMode: false,
|
||||
popupPanelHeightMode: 0,
|
||||
requestJournalProcessPeriod: 1000,
|
||||
selfieAfter: 3,
|
||||
|
|
|
@ -269,6 +269,7 @@ const popupDataFromTabId = function(tabId, tabTitle) {
|
|||
const tabContext = µb.tabContextManager.mustLookup(tabId);
|
||||
const rootHostname = tabContext.rootHostname;
|
||||
const µbus = µb.userSettings;
|
||||
const µbhs = µb.hiddenSettings;
|
||||
const r = {
|
||||
advancedUserEnabled: µbus.advancedUserEnabled,
|
||||
appName: vAPI.app.name,
|
||||
|
@ -278,7 +279,8 @@ const popupDataFromTabId = function(tabId, tabTitle) {
|
|||
firewallPaneMinimized: µbus.firewallPaneMinimized,
|
||||
globalAllowedRequestCount: µb.localSettings.allowedRequestCount,
|
||||
globalBlockedRequestCount: µb.localSettings.blockedRequestCount,
|
||||
fontSize: µb.hiddenSettings.popupFontSize,
|
||||
fontSize: µbhs.popupFontSize,
|
||||
godMode: µbhs.filterAuthorMode || µbhs.popupPanelGodMode,
|
||||
netFilteringSwitch: false,
|
||||
rawURL: tabContext.rawURL,
|
||||
pageURL: tabContext.normalURL,
|
||||
|
@ -288,16 +290,16 @@ const popupDataFromTabId = function(tabId, tabTitle) {
|
|||
pageBlockedRequestCount: 0,
|
||||
popupBlockedCount: 0,
|
||||
popupPanelSections: µbus.popupPanelSections,
|
||||
popupPanelDisabledSections: µb.hiddenSettings.popupPanelDisabledSections,
|
||||
popupPanelLockedSections: µb.hiddenSettings.popupPanelLockedSections,
|
||||
popupPanelHeightMode: µb.hiddenSettings.popupPanelHeightMode,
|
||||
popupPanelDisabledSections: µbhs.popupPanelDisabledSections,
|
||||
popupPanelLockedSections: µbhs.popupPanelLockedSections,
|
||||
popupPanelHeightMode: µbhs.popupPanelHeightMode,
|
||||
tabId: tabId,
|
||||
tabTitle: tabTitle,
|
||||
tooltipsDisabled: µbus.tooltipsDisabled
|
||||
};
|
||||
|
||||
if ( µb.hiddenSettings.uiPopupConfig !== 'undocumented' ) {
|
||||
r.uiPopupConfig = µb.hiddenSettings.uiPopupConfig;
|
||||
if ( µbhs.uiPopupConfig !== 'undocumented' ) {
|
||||
r.uiPopupConfig = µbhs.uiPopupConfig;
|
||||
}
|
||||
|
||||
const pageStore = µb.pageStoreFromTabId(tabId);
|
||||
|
|
|
@ -644,6 +644,13 @@ let renderOnce = function() {
|
|||
if ( popupData.popupPanelHeightMode === 1 ) {
|
||||
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