From 6b7e95d273aa7b747fbb3e2134a88de9103eb370 Mon Sep 17 00:00:00 2001 From: Nilesh Date: Tue, 11 Aug 2020 01:24:45 +0530 Subject: [PATCH] Added close Button, removed activeTab permission, updated description and version bump --- contentscript.js | 14 +++++++++++--- manifest.json | 6 +++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/contentscript.js b/contentscript.js index f2d69ea..5eaffa9 100644 --- a/contentscript.js +++ b/contentscript.js @@ -70,14 +70,22 @@ function showBetter(match) { } let dismissButton = document.createElement("button"); - dismissButton.innerHTML = "✗ Dismiss suggestion for this URL"; - dismissButton.setAttribute("style", "display: block; font-size: 14px; margin: 16px auto;"); + dismissButton.innerHTML = "✗ Do not show suggestion for this URL"; + dismissButton.setAttribute("style", "display: block; font-size: 14px; margin: 16px auto; cursor:pointer;"); dismissButton.addEventListener("click", () => { document.body.removeChild(betterdiv); dismissPermanently(match); }) - betterdiv.appendChild(dismissButton); + + let closeButton = document.createElement("button"); + closeButton.innerText = "❌"; + closeButton.setAttribute("style", "position: absolute; top: -10px; right: -10px; cursor:pointer; background-color: white; border-radius: 15px; border: thin solid #aaa;"); + closeButton.addEventListener("click", () => { + document.body.removeChild(betterdiv); + }) + betterdiv.appendChild(closeButton); + document.body.appendChild(betterdiv); } diff --git a/manifest.json b/manifest.json index 05b7034..427ca2e 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name": "Better", - "version": "0.0.1", + "version": "0.1.0", "icons": { "48": "images/48.png", "128": "images/128.png" @@ -10,8 +10,8 @@ "id": "{02d8a7bd-79ba-4808-8e11-f3e19af43f90}" } }, - "description": "Find better products & services than the one you're currently visiting", - "permissions": ["activeTab", "storage"], + "description": "This extension looks at your current URL, and recommends BETTER product/service alternatives via an in-page pop-up. BETTER could mean ethical / privacy-conscious / secure / local / cheaper / high-quality etc. The extension ships with a default list of recommendations but you can subscribe to lists maintained by others. This allows different interpretations of BETTER to exist and you can subscribe to those that appeals to your preferences the most.", + "permissions": ["storage"], "background": { "scripts": ["background.js"], "persistent": false