diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 470ee4401..e3b58d437 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -267,6 +267,14 @@ "message": "Version", "description": "Example of use: Version 1.26.4" }, + "popup3pScriptFilterTip": { + "message": "↑: Emphasize rows which have 3rd-party scripts", + "description": "Tooltip shown when hovering small filtering widget in '3rd-party scripts' cell" + }, + "popup3pFrameFilterTip": { + "message": "↑: Emphasize rows which have 3rd-party frames", + "description": "Tooltip shown when hovering small filtering widget in '3rd-party frames' cell" + }, "pickerCreate": { "message": "Create", "description": "English: Create" diff --git a/src/js/popup-fenix.js b/src/js/popup-fenix.js index 7b0383f4c..8032f2ed3 100644 --- a/src/js/popup-fenix.js +++ b/src/js/popup-fenix.js @@ -1374,35 +1374,19 @@ uDom('#saveRules').on('click', saveFirewallRules); uDom('#revertRules').on('click', ( ) => { revertFirewallRules(); }); uDom('a[href]').on('click', gotoURL); -// Toggle emphasis of rows with[out] 3rd-party scripts/frames -{ - const nextStep = (target, steps) => { - const firewall = document.getElementById('firewall'); - const cl = firewall.classList; - if ( cl.contains(steps[0]) ) { - cl.remove(steps[0]); - if ( firewall.querySelector(target) !== null ) { - cl.add(steps[1]); - } - return; - } - if ( cl.contains(steps[1]) ) { - cl.remove(steps[1]); - return; - } - cl.add(steps[0]); - }; - document.querySelector('#firewall > [data-type="3p-script"] .filter') - .addEventListener('click', ( ) => { - nextStep('.is3p.hasScript', [ 'show3pScript', 'hide3pScript' ]); - }); +/******************************************************************************/ - // Toggle visibility of rows with[out] 3rd-party frames - document.querySelector('#firewall > [data-type="3p-frame"] .filter') - .addEventListener('click', ( ) => { - nextStep('.is3p.hasFrame', [ 'show3pFrame', 'hide3pFrame' ]); - }); -} +// Toggle emphasis of rows with[out] 3rd-party scripts/frames +document.querySelector('#firewall > [data-type="3p-script"] .filter') + .addEventListener('click', ( ) => { + document.getElementById('firewall').classList.toggle('show3pScript'); + }); + +// Toggle visibility of rows with[out] 3rd-party frames +document.querySelector('#firewall > [data-type="3p-frame"] .filter') + .addEventListener('click', ( ) => { + document.getElementById('firewall').classList.toggle('show3pFrame'); + }); /******************************************************************************/ diff --git a/src/popup-fenix.html b/src/popup-fenix.html index 2ef5ef2d6..1490ea673 100644 --- a/src/popup-fenix.html +++ b/src/popup-fenix.html @@ -82,8 +82,8 @@