From 23462ff89b8697af20991fd9aba5e91fc76840f6 Mon Sep 17 00:00:00 2001 From: Bruno Bernardino Date: Wed, 20 Mar 2024 16:18:32 +0000 Subject: [PATCH] Fix FastGPT disappearing This fixes a problem where the FastGPT input would disappear if the user hadn't given permissions for the summarizer but had a Kagi session or token input, when coming back from the advanced settings (https://kagifeedback.org/d/3589-kagi-chrome-extension-fastgpt-disappears-after-returning-from-settings-pane). Also updates dev dependencies. --- package-lock.json | 88 ++++++++++++++++++++++----------------------- package.json | 6 ++-- shared/src/popup.js | 8 +++-- 3 files changed, 52 insertions(+), 50 deletions(-) diff --git a/package-lock.json b/package-lock.json index dea2616..c06a17a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,9 +9,9 @@ "version": "1.0.0", "license": "MIT", "devDependencies": { - "@biomejs/biome": "1.5.3", - "adm-zip": "0.5.10", - "nodemon": "3.0.3" + "@biomejs/biome": "1.6.1", + "adm-zip": "0.5.12", + "nodemon": "3.1.0" }, "engines": { "node": "20.x", @@ -19,9 +19,9 @@ } }, "node_modules/@biomejs/biome": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.5.3.tgz", - "integrity": "sha512-yvZCa/g3akwTaAQ7PCwPWDCkZs3Qa5ONg/fgOUT9e6wAWsPftCjLQFPXBeGxPK30yZSSpgEmRCfpGTmVbUjGgg==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.6.1.tgz", + "integrity": "sha512-SILQvA2S0XeaOuu1bivv6fQmMo7zMfr2xqDEN+Sz78pGbAKZnGmg0emsXjQWoBY/RVm9kPCgX+aGEpZZTYaM7w==", "dev": true, "hasInstallScript": true, "bin": { @@ -35,20 +35,20 @@ "url": "https://opencollective.com/biome" }, "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "1.5.3", - "@biomejs/cli-darwin-x64": "1.5.3", - "@biomejs/cli-linux-arm64": "1.5.3", - "@biomejs/cli-linux-arm64-musl": "1.5.3", - "@biomejs/cli-linux-x64": "1.5.3", - "@biomejs/cli-linux-x64-musl": "1.5.3", - "@biomejs/cli-win32-arm64": "1.5.3", - "@biomejs/cli-win32-x64": "1.5.3" + "@biomejs/cli-darwin-arm64": "1.6.1", + "@biomejs/cli-darwin-x64": "1.6.1", + "@biomejs/cli-linux-arm64": "1.6.1", + "@biomejs/cli-linux-arm64-musl": "1.6.1", + "@biomejs/cli-linux-x64": "1.6.1", + "@biomejs/cli-linux-x64-musl": "1.6.1", + "@biomejs/cli-win32-arm64": "1.6.1", + "@biomejs/cli-win32-x64": "1.6.1" } }, "node_modules/@biomejs/cli-darwin-arm64": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.5.3.tgz", - "integrity": "sha512-ImU7mh1HghEDyqNmxEZBoMPr8SxekkZuYcs+gynKlNW+TALQs7swkERiBLkG9NR0K1B3/2uVzlvYowXrmlW8hw==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.6.1.tgz", + "integrity": "sha512-KlvY00iB9T/vFi4m/GXxEyYkYnYy6aw06uapzUIIdiMMj7I/pmZu7CsZlzWdekVD0j+SsQbxdZMsb0wPhnRSsg==", "cpu": [ "arm64" ], @@ -62,9 +62,9 @@ } }, "node_modules/@biomejs/cli-darwin-x64": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.5.3.tgz", - "integrity": "sha512-vCdASqYnlpq/swErH7FD6nrFz0czFtK4k/iLgj0/+VmZVjineFPgevOb+Sr9vz0tk0GfdQO60bSpI74zU8M9Dw==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.6.1.tgz", + "integrity": "sha512-jP4E8TXaQX5e3nvRJSzB+qicZrdIDCrjR0sSb1DaDTx4JPZH5WXq/BlTqAyWi3IijM+IYMjWqAAK4kOHsSCzxw==", "cpu": [ "x64" ], @@ -78,9 +78,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.5.3.tgz", - "integrity": "sha512-cupBQv0sNF1OKqBfx7EDWMSsKwRrBUZfjXawT4s6hKV6ALq7p0QzWlxr/sDmbKMLOaLQtw2Qgu/77N9rm+f9Rg==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.6.1.tgz", + "integrity": "sha512-nxD1UyX3bWSl/RSKlib/JsOmt+652/9yieogdSC/UTLgVCZYOF7u8L/LK7kAa0Y4nA8zSPavAQTgko7mHC2ObA==", "cpu": [ "arm64" ], @@ -94,9 +94,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64-musl": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.5.3.tgz", - "integrity": "sha512-DYuMizUYUBYfS0IHGjDrOP1RGipqWfMGEvNEJ398zdtmCKLXaUvTimiox5dvx4X15mBK5M2m8wgWUgOP1giUpQ==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.6.1.tgz", + "integrity": "sha512-YdkDgFecdHJg7PJxAMaZIixVWGB6St4yH08BHagO0fEhNNiY8cAKEVo2mcXlsnEiTMpeSEAY9VxLUrVT3IVxpw==", "cpu": [ "arm64" ], @@ -110,9 +110,9 @@ } }, "node_modules/@biomejs/cli-linux-x64": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.5.3.tgz", - "integrity": "sha512-YQrSArQvcv4FYsk7Q91Yv4uuu5F8hJyORVcv3zsjCLGkjIjx2RhjYLpTL733SNL7v33GmOlZY0eFR1ko38tuUw==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.6.1.tgz", + "integrity": "sha512-BYAzenlMF3QdngjNFw9QVBXKGNzeecqwF3pwDgUGEvU7OJpn1/lyVkJVxYPtVGRNdjQ9e6l/s8NjKuBpW/ZR4Q==", "cpu": [ "x64" ], @@ -126,9 +126,9 @@ } }, "node_modules/@biomejs/cli-linux-x64-musl": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.5.3.tgz", - "integrity": "sha512-UUHiAnlDqr2Y/LpvshBFhUYMWkl2/Jn+bi3U6jKuav0qWbbBKU/ByHgR4+NBxpKBYoCtWxhnmatfH1bpPIuZMw==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.6.1.tgz", + "integrity": "sha512-aSISIDmxq04NNy7tm4x9rBk2vH0ub2VDIE4outEmdC2LBtEJoINiphlZagx/FvjbsqUfygent9QUSn0oREnAXg==", "cpu": [ "x64" ], @@ -142,9 +142,9 @@ } }, "node_modules/@biomejs/cli-win32-arm64": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.5.3.tgz", - "integrity": "sha512-HxatYH7vf/kX9nrD+pDYuV2GI9GV8EFo6cfKkahAecTuZLPxryHx1WEfJthp5eNsE0+09STGkKIKjirP0ufaZA==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.6.1.tgz", + "integrity": "sha512-/eCHQKZ1kEawUpkSuXq4urtxMsD1P1678OPG3zNKt3ru16AqqspLdO3jzBe3k74xCPYnQ36e9Yqc97Mo0qgPtg==", "cpu": [ "arm64" ], @@ -158,9 +158,9 @@ } }, "node_modules/@biomejs/cli-win32-x64": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.5.3.tgz", - "integrity": "sha512-fMvbSouZEASU7mZH8SIJSANDm5OqsjgtVXlbUqxwed6BP7uuHRSs396Aqwh2+VoW8fwTpp6ybIUoC9FrzB0kyA==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.6.1.tgz", + "integrity": "sha512-5TUZbzBwnDLFxLVGEPsorNi6eC2Gt+z4Oei9Qvq0M/4c4/mjZ96ABgwao/tMxf4ZBr/qyy2YdvF+gX9Rc+xC0A==", "cpu": [ "x64" ], @@ -180,9 +180,9 @@ "dev": true }, "node_modules/adm-zip": { - "version": "0.5.10", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.10.tgz", - "integrity": "sha512-x0HvcHqVJNTPk/Bw8JbLWlWoo6Wwnsug0fnYYro1HBrjxZ3G7/AZk7Ahv8JwDe1uIcz8eBqvu86FuF1POiG7vQ==", + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.12.tgz", + "integrity": "sha512-6TVU49mK6KZb4qG6xWaaM4C7sA/sgUMLy/JYMOzkcp3BvVLpW0fXDFQiIzAuxFCt/2+xD7fNIiPFAoLZPhVNLQ==", "dev": true, "engines": { "node": ">=6.0" @@ -414,9 +414,9 @@ "dev": true }, "node_modules/nodemon": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.0.3.tgz", - "integrity": "sha512-7jH/NXbFPxVaMwmBCC2B9F/V6X1VkEdNgx3iu9jji8WxWcvhMWkmhNWhI5077zknOnZnBzba9hZP6bCPJLSReQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.0.tgz", + "integrity": "sha512-xqlktYlDMCepBJd43ZQhjWwMw2obW/JRvkrLxq5RCNcuDDX1DbcPT+qT1IlIIdf+DhnWs90JpTMe+Y5KxOchvA==", "dev": true, "dependencies": { "chokidar": "^3.5.2", diff --git a/package.json b/package.json index 22a83ee..2f52a1d 100644 --- a/package.json +++ b/package.json @@ -25,9 +25,9 @@ }, "homepage": "https://github.com/kagisearch/browser_extensions#readme", "devDependencies": { - "@biomejs/biome": "1.5.3", - "adm-zip": "0.5.10", - "nodemon": "3.0.3" + "@biomejs/biome": "1.6.1", + "adm-zip": "0.5.12", + "nodemon": "3.1.0" }, "engines": { "node": "20.x", diff --git a/shared/src/popup.js b/shared/src/popup.js index 081b38a..f513bb9 100644 --- a/shared/src/popup.js +++ b/shared/src/popup.js @@ -266,6 +266,8 @@ async function setup() { closeSettingsIcon.style.display = 'none'; tokenDiv.style.display = 'none'; if (tokenInput.value) { + fastGptSection.style.display = ''; + const hasPermissions = await browser.permissions.contains({ permissions: ['activeTab'], }); @@ -273,12 +275,12 @@ async function setup() { if (!hasPermissions) { summarizeSection.style.display = 'none'; requestPermissionsSection.style.display = ''; - fastGptSection.style.display = 'none'; } else { summarizeSection.style.display = ''; requestPermissionsSection.style.display = 'none'; - fastGptSection.style.display = ''; } + } else { + fastGptSection.style.display = 'none'; } advancedToggle.setAttribute('title', 'Advanced settings'); } else { @@ -369,7 +371,7 @@ async function setup() { if ( platformInfo.os === 'android' && browserInfo?.version && - parseInt(browserInfo.version, 10) <= 118 + Number.parseInt(browserInfo.version, 10) <= 118 ) { requestPermissionsButton.addEventListener('click', () => { alert('Cannot request activeTab permission on Android yet.');