From 25dd6dbdc553e05c65684716e243bb1d5cd35773 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Sun, 27 Nov 2022 20:01:06 -0800 Subject: [PATCH] fix it better --- extension/popup.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extension/popup.js b/extension/popup.js index ca99fae..1fcc679 100644 --- a/extension/popup.js +++ b/extension/popup.js @@ -28,8 +28,8 @@ document.getElementById("save-login").addEventListener("click", function () { let parsed = new URL(url); let toStore = { "access": { - "url": parsed.host, - "port": parsed.port || '80', + "url": `${parsed.protocol}//${parsed.hostname}`, + "port": parsed.port || (parsed.protocol === 'https' ? '443' : '80'), "apiKey": document.getElementById("api-key").value } };