From cfbce6eed10e41c3c310db64ed9c21fee0328751 Mon Sep 17 00:00:00 2001 From: SolninjaA <51935570+SolninjaA@users.noreply.github.com> Date: Mon, 13 Jan 2025 17:24:14 +1000 Subject: [PATCH] Changing code for Firefox submission --- background.js | 5 ++--- manifest.json | 3 +-- options.html | 2 +- options.js | 5 ----- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/background.js b/background.js index eeff54d..92ad1b2 100644 --- a/background.js +++ b/background.js @@ -77,7 +77,6 @@ function validateURL(url) { return browser.storage.local.get("allowedProtocols").then(({ allowedProtocols }) => { // Initialize a list of protocols that are allowed if unset. // This needs to be synced with the initialization code in options.js. - console.log(allowedProtocols); if (allowedProtocols === undefined) { allowedProtocols = new Set(); allowedProtocols.add("http:"); @@ -112,12 +111,12 @@ function generateChhotoRequest(url) { // If the user didn't specify an API key if (!data.chhotoKey) { return Promise.reject(new Error( - "Missing API Key. Please configure the Chhoto URL extension. See https://git.solomon.tech/solomon/Chhoto-URL-Extension for more information." + "Missing API Key. Please configure the Chhoto URL extension. See https://git.solomon.tech/solomon/Chhoto-URL-Extension#installation for more information." )); } // If the user didn't specify an API key or a host if (!data.chhotoKey || !data.chhotoHost) { - return Promise.reject(new Error("Please configure the Chhoto URL extension. See https://git.solomon.tech/solomon/Chhoto-URL-Extension for more information.")); + return Promise.reject(new Error("Please configure the Chhoto URL extension. See https://git.solomon.tech/solomon/Chhoto-URL-Extension#installation for more information.")); } data.longUrl = url.href; diff --git a/manifest.json b/manifest.json index dc94b5f..5f7f920 100644 --- a/manifest.json +++ b/manifest.json @@ -16,8 +16,7 @@ "notifications", "clipboardWrite", "storage", - "https://*/*", - "http://*/*" + "https://*/*" ], "options_ui": { "page": "options.html" diff --git a/options.html b/options.html index 7c706f0..4c97e02 100644 --- a/options.html +++ b/options.html @@ -102,7 +102,7 @@

Don't have one? See here for more information.

-

A non-HTTPS connection is insecure! Only use this if you are testing.

+

A non-HTTPS connection is insecure! This is disallowed as per Firefox's development practices.

API Key

diff --git a/options.js b/options.js index 4a3160b..86b21b4 100644 --- a/options.js +++ b/options.js @@ -68,13 +68,8 @@ hostKeyEle.oninput = (event) => { // Remove the "warning" class messageEle.classList.remove("warning"); } catch (err) { - // If the URL is NOT invalid because of a TypeError if (err.name !== "TypeError") { messageEle.classList.add("warning"); - - // Save the host - browserStorage.set({ chhotoHost }); - // Else, remove warning } else { messageEle.classList.remove("warning");