Skip to content

Commit c8a55d8

Browse files
committed
Make a version for Firefox
1 parent 581fd31 commit c8a55d8

File tree

5 files changed

+31
-7
lines changed

5 files changed

+31
-7
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,10 @@ Load `dist` directory.
106106
## Test
107107

108108
Run `npx jest` or `npm run test`.
109+
110+
## Firefox version
111+
112+
- [Listing](https://addons.mozilla.org/en-US/developers/addon/r3bl-shortlink/)
113+
- [PR with changes made for this version]()
114+
- [Info on porting from chrome to firefox extension](https://decembergarnetsmith.com/2024/05/10/how-to-port-an-mv3-chrome-extension-to-firefox/)
115+
- [Differences between chrome and firefox extensions](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/background#browser_support)

public/manifest.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
{
2+
"browser_specific_settings": {
3+
"gecko": {
4+
"id": "{6cb822ee-13fa-4b44-babf-be5e2c5a27f1}"
5+
}
6+
},
27
"manifest_version": 3,
38
"name": "R3BL Shortlink",
49
"description": "Make go links",
5-
"version": "4.12",
10+
"version": "4.13",
611
"icons": {
712
"16": "icon16.png",
813
"32": "icon32.png",
@@ -23,7 +28,10 @@
2328
"keyword": "go"
2429
},
2530
"background": {
26-
"service_worker": "js/background.js"
31+
"service_worker": "js/background.js",
32+
"scripts": [
33+
"js/background.js"
34+
]
2735
},
2836
"commands": {
2937
"_execute_action": {

shortlink.zip

124 Bytes
Binary file not shown.

src/app/App.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import {
4242

4343
export function App() {
4444
const textareaRef = useRef<HTMLTextAreaElement>(null)
45+
const inputReference = useRef<HTMLInputElement>(null);
4546
const [allShortlinks, setAllShortlinks] = useState<types.Shortlink[]>([])
4647
const [userInputText, setUserInputText] = useState<string>("")
4748
const [searchText, setSearchText] = useState<string>("")
@@ -78,6 +79,11 @@ export function App() {
7879
storage_provider.getBrowserHostProvider().setBadgeText(allShortlinks.length.toString())
7980
}, [allShortlinks])
8081

82+
// Focus input on load.
83+
useEffect(() => {
84+
inputReference?.current?.focus();
85+
}, [])
86+
8187
const filteredShortlinks = searchText
8288
? allShortlinks.filter((shortlink) => shortlink.name.match(new RegExp(searchText, "i")))
8389
: allShortlinks
@@ -90,6 +96,7 @@ export function App() {
9096
return (
9197
<div id="app">
9298
<input
99+
ref={inputReference}
93100
autoFocus={true}
94101
id="shortlink-input"
95102
placeholder='Type a name for your tab(s) or "copy/c, go/g, delete/d <name>" => Enter'

src/style.css

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,17 @@
3030
--default-padding: 8px;
3131
--default-border-radius: 6px;
3232
--default-border-style: 2px solid rgb(119, 129, 147);
33-
--max-height-of-popup: 300px;
34-
width: 750px;
3533
--default-animation-duration: 0.5s;
34+
--popup-min-height: 600px;
35+
--popup-min-width: 800px;
36+
}
37+
38+
html {
39+
min-height: var(--popup-min-height);
40+
min-width: var(--popup-min-width);
3641
}
3742

3843
body {
39-
width: 100%;
40-
height: 100%;
4144
margin: var(--default-margin);
4245
padding: var(--default-padding);
4346
background: #5f6176;
@@ -48,7 +51,6 @@ body {
4851
display: flex;
4952
flex-direction: row;
5053
flex-wrap: wrap;
51-
max-height: var(--max-height-of-popup);
5254
overflow-y: auto;
5355
}
5456

0 commit comments

Comments
 (0)