Skip to content

Commit 8a3c830

Browse files
authored
Merge pull request #2517 from mneunomne/#2516
#2516
2 parents 8c861d2 + 881ce81 commit 8a3c830

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "3.20.0",
2+
"version": "3.20.1.1",
33
"key": "ilkggpgmkemaniponkfgnkonpajankkm",
44
"author": "Daniel C. Howe",
55
"background": {

src/css/menu.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,10 @@ body.en .btn_radio_label {
764764
opacity: 1;
765765
}
766766

767+
#disable:not(.popup_open):checked + .btn_radio_label .popup_arrow {
768+
opacity: 0;
769+
}
770+
767771
#on_domain-lbl {
768772
text-align: center;
769773
}

src/js/adn/core.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2375,7 +2375,10 @@ const adnauseam = (function () {
23752375

23762376
if (typeof adnauseam[request.what] === 'function') {
23772377

2378-
request.url && (request.url = trimChar(request.url, '/')); // no trailing slash
2378+
if (request.what !== 'toggleEnabled') { // fix for https://github.com/dhowe/AdNauseam/issues/2516
2379+
// Why do we do this?
2380+
request.url && (request.url = trimChar(request.url, '/')); // no trailing slash
2381+
}
23792382
callback(adnauseam[request.what](request, pageStore, tabId, frameId));
23802383
adnauseam.markUserAction(); // assume user-initiated and thus no longer 'idle'
23812384

src/js/adn/menu.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ import { broadcast, onBroadcast } from '../broadcast.js';
634634
break;
635635
case 'active':
636636
toggleStrictAlert(popupData.pageURL, false)
637+
uDom("#on_domain").prop('checked', true);
637638
toggleEnabled(evt, true)
638639
if (initialButtonState === 'strict') {
639640
updateRefreshNotification(currentNotifications)
@@ -657,14 +658,14 @@ import { broadcast, onBroadcast } from '../broadcast.js';
657658
const onChangeDisabledScope = function (evt) {
658659
// check if url is domain home
659660
let url = new URL(popupData.pageURL)
660-
let isDomainHome = url.pathname === '/' || url.pathname === '/index.html' || url.pathname === '/index.php'
661-
var scope = uDom(".disable_type_radio:checked") && !isDomainHome ? uDom(".disable_type_radio:checked").val() : ''
661+
// let isDomainHome = url.pathname === '/' || url.pathname === '/index.html' || url.pathname === '/index.php'
662+
var scope = uDom(".disable_type_radio:checked") ? uDom(".disable_type_radio:checked").val() : ''
662663
// first remove previous whichever previous scope from whitelist
663664
vAPI.messaging.send(
664665
'adnauseam', {
665666
what: 'toggleEnabled',
666667
url: popupData.pageURL,
667-
scope: scope,
668+
scope: scope == '' ? 'page' : '', // remove the inverted scope
668669
state: true,
669670
tabId: popupData.tabId
670671
}).then(() => {
@@ -699,7 +700,7 @@ import { broadcast, onBroadcast } from '../broadcast.js';
699700
'adnauseam', {
700701
what: 'toggleEnabled',
701702
url: popupData.pageURL,
702-
scope: (evt.altKey || evt.metaKey) && !isDomainHome ? 'page' : '',
703+
scope: '',
703704
state: state,
704705
tabId: popupData.tabId
705706
});
@@ -716,6 +717,7 @@ import { broadcast, onBroadcast } from '../broadcast.js';
716717
}
717718

718719
const closePopup = function () {
720+
uDom("#disable").removeClass("popup_open")
719721
uDom(".popup_arrow").removeClass("open")
720722
uDom(".inner-popup_wrapper").addClass("hidden")
721723
document.removeEventListener('click', onAnyClickAfterOpen)
@@ -724,6 +726,7 @@ import { broadcast, onBroadcast } from '../broadcast.js';
724726
}
725727

726728
const openPopup = function () {
729+
uDom("#disable").addClass("popup_open")
727730
uDom(".popup_arrow").addClass("open")
728731
uDom(".inner-popup_wrapper").removeClass("hidden");
729732
document.addEventListener('click', onAnyClickAfterOpen)

0 commit comments

Comments
 (0)