diff --git a/browserAction/browserAction.css b/browserAction/browserAction.css index 83de871..c38ec98 100644 --- a/browserAction/browserAction.css +++ b/browserAction/browserAction.css @@ -42,4 +42,23 @@ div { } #addonStatus.on { background-image: url(../icons/browserAction-CBon.svg); +} + +#reload { + cursor: pointer; + vertical-align: text-bottom; + height: 19px; + width: 19px; + margin-right: 0.25em; + background-color: currentColor; + mask-size: 100%; + display: inline-block; + mask-image: url(../icons/browserAction-reload.svg); + position: absolute; + top: calc(5px + 0.5em); + right: 0.5em; +} + +#reload.hidden { + display: none; } \ No newline at end of file diff --git a/browserAction/browserAction.html b/browserAction/browserAction.html index da628c5..3c1e948 100644 --- a/browserAction/browserAction.html +++ b/browserAction/browserAction.html @@ -8,6 +8,7 @@ +
diff --git a/browserAction/browserAction.js b/browserAction/browserAction.js index 158fb12..77901b9 100644 --- a/browserAction/browserAction.js +++ b/browserAction/browserAction.js @@ -23,8 +23,14 @@ } const currentURL = new URL(currentTab.url); + const reloadButton = document.getElementById("reload"); + reloadButton.addEventListener("click", async function(){ + await browser.tabs.reload(currentTab.id); + window.close(); + }); const addonStatus = document.getElementById("addonStatus"); addonStatus.addEventListener("click", async function(){ + reloadButton.classList.toggle("hidden"); if (isWhitelisted(currentURL)){ settingContainers.resetUrlValue("blockMode", currentURL); if (settings.get("blockMode").startsWith("allow")){ diff --git a/icons/browserAction-CBoff.svg b/icons/browserAction-CBoff.svg index ddd4df2..b225c1b 100644 --- a/icons/browserAction-CBoff.svg +++ b/icons/browserAction-CBoff.svg @@ -5,7 +5,7 @@ id="svg2" sodipodi:docname="browserAction-whitelisted.svg" inkscape:version="0.92.2 2405546, 2018-03-11" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="96px" height="96px" viewBox="0 0 96 96" enable-background="new 0 0 96 96" xml:space="preserve"> - + - + diff --git a/icons/browserAction-CBon.svg b/icons/browserAction-CBon.svg index 2b9b980..7242d04 100644 --- a/icons/browserAction-CBon.svg +++ b/icons/browserAction-CBon.svg @@ -5,7 +5,7 @@ id="svg2" sodipodi:docname="browserAction-notPrinted.svg" inkscape:version="0.92.2 2405546, 2018-03-11" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="96px" height="96px" viewBox="0 0 96 96" enable-background="new 0 0 96 96" xml:space="preserve"> - + - + diff --git a/icons/browserAction-reload.svg b/icons/browserAction-reload.svg new file mode 100644 index 0000000..5a4102a --- /dev/null +++ b/icons/browserAction-reload.svg @@ -0,0 +1,109 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + +