From d559111c785d040f93e0661b42dc33f918f09b43 Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Thu, 5 Sep 2024 11:03:17 +0200 Subject: [PATCH] fix(modal): #190 --- modal/modal.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modal/modal.js b/modal/modal.js index 7aa2fc4..c4fe9d8 100755 --- a/modal/modal.js +++ b/modal/modal.js @@ -38,7 +38,7 @@ function open_popup(newurl, width, height) { }); } -/* DO you want to open the url in a container? */ +/* Do you want to open the url in a container? */ function open_container_tab(newurl, cookieStoreId) { browser.runtime.sendMessage({ type: 'share-backid-container', @@ -163,6 +163,13 @@ function registerShareButtons(tab) { ); promisedButtons.then(function (buttons) { + var shares = document.querySelectorAll(".share").length; + if (shares === 1) { + document.getElementsByClassName("share")[0].click(function() { + window.close(); + }); + } + resize_buttons(); var buttonsWithPriority = Promise.all( buttons.map(function (button) {