Skip to content

Commit

Permalink
Add FastGPT input and Small Web link - v0.5.0 (#62)
Browse files Browse the repository at this point in the history
This implements a FastGPT input and Small Web link (with support for adding more links in the future). Both only show up _after_ having a valid session.

Because of the FastGPT input, if you have a valid session, opening the popup will now automatically focus that input field, so you can start typing right away. Pressing enter opens the FastGPT window with the query prefilled.

Clicking "Small Web" simply opens a new tab with that URL.

This also implements a fail-safe for issues reported in https://kagifeedback.org/d/2234-kagi-extension-api-key-not-persistent-in-firefox-esr-on-kali-linux and https://kagifeedback.org/d/2090-kagi-keeps-saying-invalid-session-token-in-firefox-on-linux-after-setting-up-successfully-and-working-fine-for-a-while and https://kagifeedback.org/d/2748-firefox-default-search-engine-keeps-resetting and hopefully make those easier to self-fix.

Finally, some linter and formatter tweaks and fixes were also added here, and the dependencies updated.
  • Loading branch information
BrunoBernardino authored Jan 19, 2024
1 parent 799429d commit 4600fcb
Show file tree
Hide file tree
Showing 8 changed files with 237 additions and 80 deletions.
3 changes: 2 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
"indentWidth": 2,
"ignore": ["built/", "safari/"]
},
"javascript": {
"formatter": {
Expand Down
2 changes: 1 addition & 1 deletion chrome/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Kagi Search for Chrome",
"version": "0.4.3",
"version": "0.5.0",
"description": "A simple extension for setting Kagi as a default search engine, and automatically logging in to Kagi in incognito browsing windows",
"background": {
"service_worker": "src/background.js",
Expand Down
2 changes: 1 addition & 1 deletion firefox/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Kagi Search for Firefox",
"version": "0.4.3",
"version": "0.5.0",
"description": "A simple helper extension for setting Kagi as a default search engine, and automatically logging in to Kagi in incognito browsing windows.",
"background": {
"page": "src/background_page.html"
Expand Down
122 changes: 82 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
},
"homepage": "https://github.com/kagisearch/browser_extensions#readme",
"devDependencies": {
"@biomejs/biome": "1.4.1",
"@biomejs/biome": "1.5.2",
"adm-zip": "0.5.10",
"nodemon": "3.0.1"
"nodemon": "3.0.3"
},
"engines": {
"node": "20.x",
Expand Down
56 changes: 48 additions & 8 deletions shared/src/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ input {
border: 1px solid #e1e0db;
}

input[type="password"] {
input[type="password"], input[type="text"] {
background-color: #f7f6f2;
border: 1px solid #e1e0db;
height: 48px;
border-radius: 5px;
padding: 0 10px;
}

input[type="password"]:focus {
input[type="password"]:focus, input[type="text"]:focus {
outline: 1px solid #ffb319;
}

Expand All @@ -60,15 +60,41 @@ input[type="password"]:focus {
.logo {
width: 58px;
height: 29px;
flex: 1;
flex: 0;
justify-content: flex-start;
display: flex;
margin: 0 15px;
}

.logo svg {
height: 100%;
}

#links {
flex: 1;
justify-content: flex-start;
display: flex;
font-size: 11px;
color: rgba(0, 0, 0, 0.6);
margin: 0 10px;
visibility: hidden;
}

#links a {
display: inline-block;
color: rgba(0, 0, 0, 0.6);
text-decoration: none;
}

#links a:hover, #links a:focus {
text-decoration: underline;
}

#links span {
display: inline-block;
margin: 0 7px;
}

#status {
font-size: 0.875rem;
flex: 0;
Expand Down Expand Up @@ -288,28 +314,37 @@ p {
right: 2px;
}

#summarize, #request_permissions {
#fastgpt, #summarize, #request_permissions {
margin-top: 10px;
width: 100%;
padding: 0 15px;
}

#summarize .setting_row, #request_permissions .setting_row {
#summarize .setting_row, #request_permissions .setting_row, #fastgpt .setting_row {
margin-top: 10px;
padding: 0;
justify-content: space-between;
}

#summarize .setting_row > div, #request_permissions .setting_row > div {
#summarize .setting_row > div, #request_permissions .setting_row > div, #fastgpt .setting_row > form {
margin-right: 10px;
}

#fastgpt_form {
width: 100%;
display: flex;
}

#fastgpt_form input {
margin-right: 10px
}

#summarize .setting_row label {
display: block;
margin-bottom: 5px;
}

#summarize_page, #request_permissions_button {
#summarize_page, #request_permissions_button, #fastgpt_submit {
background-color: #ffb319;
border: 1px solid #ffb319;
color: #191919;
Expand All @@ -323,13 +358,18 @@ p {
margin-right: 10px;
}

#fastgpt_submit {
width: 120px;
margin-right: 0;
}

#request_permissions_button {
max-width: 400px;
margin-left: auto;
margin-right: auto;
}

#summarize_page:hover, #request_permissions_button:hover {
#summarize_page:hover, #request_permissions_button:hover, #fastgpt_submit {
background-color: #f7a808;
border: 1px solid #d9950d;
}
Loading

0 comments on commit 4600fcb

Please sign in to comment.