[mv3] Make strict-blocking checkbox dependent on filtering mode

Related feedback:
https://github.com/uBlockOrigin/uBOL-home/issues/214#issuecomment-2528072997
This commit is contained in:
Raymond Hill 2024-12-09 09:42:46 -05:00
parent 51ef43c0de
commit 20a570ebe8
No known key found for this signature in database
GPG key ID: 25E1490B761470C2
3 changed files with 11 additions and 5 deletions

View file

@ -30,8 +30,9 @@ body[data-forbid~="filteringMode"] section[data-pane="settings"] > div:has(> h3[
display: none;
}
#showBlockedCount:has(input[type="checkbox"][disabled]) {
opacity: 0.5;
label:has(input[type="checkbox"][disabled]),
label:has(input[type="checkbox"][disabled]) + legend {
filter: var(--checkbox-disabled-filter);
}
#defaultFilteringMode {

View file

@ -31,8 +31,6 @@
<p><label id="autoReload" data-i18n="autoReloadLabel"><span class="input checkbox"><input type="checkbox"><svg viewBox="0 0 24 24"><path d="M1.73,12.91 8.1,19.28 22.79,4.59"/></svg></span>_</label>
</p>
<p><label id="showBlockedCount" data-i18n="showBlockedCountLabel"><span class="input checkbox"><input type="checkbox"><svg viewBox="0 0 24 24"><path d="M1.73,12.91 8.1,19.28 22.79,4.59"/></svg></span>_</label>
<p><label id="strictBlockMode" data-i18n="enableStrictBlockLabel"><span class="input checkbox"><input type="checkbox"><svg viewBox="0 0 24 24"><path d="M1.73,12.91 8.1,19.28 22.79,4.59"/></svg></span>_</label><legend data-i18n="enableStrictBlockLegend"></legend>
<p id="developerMode" hidden><label><span class="input checkbox"><input type="checkbox"><svg viewBox="0 0 24 24"><path d="M1.73,12.91 8.1,19.28 22.79,4.59"/></svg></span>Developer mode</label>
</div>
<div class="firstRun">
@ -90,6 +88,8 @@
<div data-i18n="completeFilteringModeDescription"></div>
</label>
</div>
<p><label id="strictBlockMode" data-i18n="enableStrictBlockLabel"><span class="input checkbox"><input type="checkbox"><svg viewBox="0 0 24 24"><path d="M1.73,12.91 8.1,19.28 22.79,4.59"/></svg></span>_</label><legend data-i18n="enableStrictBlockLegend"></legend>
<p id="developerMode" hidden><label><span class="input checkbox"><input type="checkbox"><svg viewBox="0 0 24 24"><path d="M1.73,12.91 8.1,19.28 22.79,4.59"/></svg></span>Developer mode</label>
</div>
<div>

View file

@ -67,7 +67,12 @@ function renderWidgets() {
}
}
qs$('#strictBlockMode input[type="checkbox"]').checked = cachedRulesetData.strictBlockMode;
{
const input = qs$('#strictBlockMode input[type="checkbox"]');
const canStrictBlock = cachedRulesetData.defaultFilteringMode > 1;
input.checked = canStrictBlock && cachedRulesetData.strictBlockMode;
dom.attr(input, 'disabled', canStrictBlock ? null : '');
}
{
dom.prop('#developerMode input[type="checkbox"]', 'checked',