Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2516 #2517

Merged
merged 2 commits into from
Mar 1, 2024
Merged

#2516 #2517

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.20.0",
"version": "3.20.1.1",
"key": "ilkggpgmkemaniponkfgnkonpajankkm",
"author": "Daniel C. Howe",
"background": {
Expand Down
4 changes: 4 additions & 0 deletions src/css/menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,10 @@ body.en .btn_radio_label {
opacity: 1;
}

#disable:not(.popup_open):checked + .btn_radio_label .popup_arrow {
opacity: 0;
}

#on_domain-lbl {
text-align: center;
}
Expand Down
5 changes: 4 additions & 1 deletion src/js/adn/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2375,7 +2375,10 @@ const adnauseam = (function () {

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

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

Expand Down
11 changes: 7 additions & 4 deletions src/js/adn/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ import { broadcast, onBroadcast } from '../broadcast.js';
break;
case 'active':
toggleStrictAlert(popupData.pageURL, false)
uDom("#on_domain").prop('checked', true);
toggleEnabled(evt, true)
if (initialButtonState === 'strict') {
updateRefreshNotification(currentNotifications)
Expand All @@ -657,14 +658,14 @@ import { broadcast, onBroadcast } from '../broadcast.js';
const onChangeDisabledScope = function (evt) {
// check if url is domain home
let url = new URL(popupData.pageURL)
let isDomainHome = url.pathname === '/' || url.pathname === '/index.html' || url.pathname === '/index.php'
var scope = uDom(".disable_type_radio:checked") && !isDomainHome ? uDom(".disable_type_radio:checked").val() : ''
// let isDomainHome = url.pathname === '/' || url.pathname === '/index.html' || url.pathname === '/index.php'
var scope = uDom(".disable_type_radio:checked") ? uDom(".disable_type_radio:checked").val() : ''
// first remove previous whichever previous scope from whitelist
vAPI.messaging.send(
'adnauseam', {
what: 'toggleEnabled',
url: popupData.pageURL,
scope: scope,
scope: scope == '' ? 'page' : '', // remove the inverted scope
state: true,
tabId: popupData.tabId
}).then(() => {
Expand Down Expand Up @@ -699,7 +700,7 @@ import { broadcast, onBroadcast } from '../broadcast.js';
'adnauseam', {
what: 'toggleEnabled',
url: popupData.pageURL,
scope: (evt.altKey || evt.metaKey) && !isDomainHome ? 'page' : '',
scope: '',
state: state,
tabId: popupData.tabId
});
Expand All @@ -716,6 +717,7 @@ import { broadcast, onBroadcast } from '../broadcast.js';
}

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

const openPopup = function () {
uDom("#disable").addClass("popup_open")
uDom(".popup_arrow").addClass("open")
uDom(".inner-popup_wrapper").removeClass("hidden");
document.addEventListener('click', onAnyClickAfterOpen)
Expand Down