Skip to content

Commit

Permalink
Merge pull request #2456 from mneunomne/#2454
Browse files Browse the repository at this point in the history
  • Loading branch information
mneunomne authored Nov 8, 2023
2 parents 98dbc94 + f001711 commit db77a15
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/js/adn/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,8 @@ import uDom from './uDom.js';
}

const hideRefreshNotification = function () {
document.querySelector('#RefreshTab').classList.add('hide');
let refreshTab = document.querySelector('#RefreshTab')
if (refreshTab) refreshTab.classList.add('hide')
adjustBlockHeight();
}

Expand Down Expand Up @@ -653,7 +654,10 @@ import uDom from './uDom.js';

// when changing "page" and "domain" scope from the popup menu on the "disable button"
const onChangeDisabledScope = function (evt) {
var scope = uDom(".disable_type_radio:checked") ? uDom(".disable_type_radio:checked").val() : ''
// 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() : ''
// first remove previous whichever previous scope from whitelist
vAPI.messaging.send(
'adnauseam', {
Expand Down Expand Up @@ -688,11 +692,13 @@ import uDom from './uDom.js';
return;
}
uDom('#main').toggleClass('disabled', !state)
let url = new URL(popupData.pageURL)
let isDomainHome = url.pathname === '/' || url.pathname === '/index.html' || url.pathname === '/index.php'
vAPI.messaging.send(
'adnauseam', {
what: 'toggleEnabled',
url: popupData.pageURL,
scope: evt.altKey || evt.metaKey ? 'page' : '',
scope: (evt.altKey || evt.metaKey) && !isDomainHome ? 'page' : '',
state: state,
tabId: popupData.tabId
});
Expand Down

0 comments on commit db77a15

Please sign in to comment.