Skip to content

Commit

Permalink
🦊 Add support for firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
MBM1607 committed Nov 13, 2024
1 parent 34c4e24 commit adaf9d7
Show file tree
Hide file tree
Showing 8 changed files with 2,979 additions and 17 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Create Release for Chrome and Firefox

on:
push:
paths:
- "manifest.chrome.json"
- "manifest.firefox.json"
- "background.js"
- "icons/**"
- "**/*.js"
branches:
- main

jobs:
build-and-release:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Node.js (for packaging or building, if required)
uses: actions/setup-node@v4
with:
node-version: "22"

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.12.3
run_install: true

- name: Build Extension for Chrome
run: pnpm build:chrome

- name: Build Extension for Firefox
run: pnpm build:firefox

- name: Create Release on GitHub
uses: softprops/action-gh-release@v2
with:
files: |
dist/chrome/chrome-extension.zip
dist/firefox/firefox-extension.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: MBM1607/bluesky-finder
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,24 @@

A simple browser extension that checks for \_atproto DNS TXT records for the current domain and provides a beautiful butterfly indicator for Bluesky presence, if found.

At the moment, this only works in Chromium-based browsers.
The extension is available for Chrome and Firefox.

## Installation
It should also work on other Chromium-based browsers.

1. Download the latest release from the [releases page](http://github.com/MBM1607/bluesky-finder/releases/latest).
## Installation (Chrome)

1. Download the latest release from the [releases page](https://github.com/MBM1607/bluesky-finder/releases/latest).
2. Unzip the downloaded file.
3. Open <chrome://extensions> in your browser and enable Developer mode.
4. Click on "Load unpacked" and select the unzipped folder.

## Installation (Firefox)

1. Download the latest release from the [releases page](https://github.com/MBM1607/bluesky-finder/releases/latest).
2. Unzip the downloaded file.
3. Open <about:debugging#/runtime/this-firefox> in your browser.
4. Click on "Load Temporary Add-on" and select the `manifest.json` file inside the unzipped folder.

### TODO

- [ ] Add support for Firefox
- [ ] Add support for Safari
4 changes: 3 additions & 1 deletion background.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ async function checkAtprotoRecord(domain) {
`https://dns.google/resolve?name=_atproto.${domain}&type=TXT`
);
const data = await response.json();
return Boolean(data.Answer && data.Answer.length > 0);
const answer = data.Answer && data.Answer[0];
console.log(answer);
return Boolean(answer && answer.type === 16);
} catch {
return false;
}
Expand Down
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions manifest.firefox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"manifest_version": 3,
"name": "BlueSky Finder",
"version": "1.0.0",
"description": "Checks for _atproto DNS TXT records for the current domain and provides a beautiful butterfly indicator for Bluesky presence, if found.",
"permissions": ["tabs", "storage"],
"action": {
"default_icon": {
"16": "icons/logo-off-16.png",
"32": "icons/logo-off-32.png",
"48": "icons/logo-off-48.png",
"128": "icons/logo-off-128.png"
}
},
"background": {
"scripts": ["background.js"]
},
"icons": {
"16": "icons/logo-16.png",
"32": "icons/logo-32.png",
"48": "icons/logo-48.png",
"128": "icons/logo-128.png"
},
"browser_specific_settings": {
"gecko": {
"id": "[email protected]",
"strict_min_version": "109.0.0"
}
}
}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "1.0.0",
"description": "Checks for _atproto DNS TXT records for the current domain and provides a beautiful butterfly indicator for Bluesky presence, if found.",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build:chrome": "cp manifest.chrome.json manifest.json && web-ext build -s . -a dist/chrome -i icons/generate-icons.sh -i dist -i manifest.firefox.json -i manifest.chrome.json -i prettier.config.cjs -i package.json -i pnpm-lock.yaml -i README.md -i cspell.json -i LICENSE -n chrome-extension.zip --overwrite-dest && rm manifest.json",
"build:firefox": "cp manifest.firefox.json manifest.json && web-ext build -s . -a dist/firefox -i icons/generate-icons.sh -i dist -i manifest.firefox.json -i manifest.chrome.json -i prettier.config.cjs -i package.json -i pnpm-lock.yaml -i README.md -i cspell.json -i LICENSE -n firefox-extension.zip --overwrite-dest && rm manifest.json"
},
"keywords": [
"bluesky",
Expand All @@ -15,6 +16,7 @@
"license": "MIT",
"packageManager": "[email protected]",
"devDependencies": {
"@types/chrome": "^0.0.280"
"@types/chrome": "^0.0.280",
"web-ext": "^8.3.0"
}
}
Loading

0 comments on commit adaf9d7

Please sign in to comment.