From a6748748614f2d5a09b22cfdc9fae0d97d2e1f45 Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 16 Feb 2021 17:03:18 +0300 Subject: [PATCH] show global styles for frames if main page is blocked fixes #1183 --- popup/popup.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/popup/popup.js b/popup/popup.js index ef717533..07329191 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -15,6 +15,7 @@ 'use strict'; let tabURL; +let isBlocked; /** @type Element */ const installed = $('#installed'); @@ -285,6 +286,7 @@ function sortStyles(entries) { function showStyles(frameResults) { const entries = new Map(); frameResults.forEach(({styles = [], url}, index) => { + if (isBlocked && !index) return; styles.forEach(style => { const {id} = style; if (!entries.has(id)) { @@ -421,7 +423,8 @@ function handleDelete(id) { } } -function blockPopup(isBlocked = true) { +function blockPopup(val = true) { + isBlocked = val; document.body.classList.toggle('blocked', isBlocked); if (isBlocked) { document.body.prepend(t.template.unavailableInfo);