Skip to content

Commit 9647085

Browse files
authored
Merge pull request #47 from harmonydata/master
Release branch brought up to date to fix to #46 and other minor tweaks
2 parents e24e212 + 88ebab9 commit 9647085

24 files changed

Lines changed: 222 additions & 1524 deletions

.DS_Store

2 KB
Binary file not shown.

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
REACT_APP_API_URL=https://api.harmonydata.ac.uk/
1+
REACT_APP_API_URL=https://api.harmonydata.ac.uk
22
REACT_APP_API_EXAMPLES=$REACT_APP_API_URL/text/examples
33
REACT_APP_API_PARSE=$REACT_APP_API_URL/text/parse
44
REACT_APP_API_MATCH=$REACT_APP_API_URL/text/match

.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
REACT_APP_API_URL=https://api.harmonydata.ac.uk/
1+
REACT_APP_API_URL=https://api.harmonydata.ac.uk
22
REACT_APP_API_EXAMPLES=$REACT_APP_API_URL/text/examples
33
REACT_APP_API_PARSE=$REACT_APP_API_URL/text/parse
44
REACT_APP_API_MATCH=$REACT_APP_API_URL/text/match

.gitignore

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,37 @@
1-
/build
1+
# Dependencies
22
/node_modules
3-
/testPDFs
4-
package-lock.json
5-
/wireframes
6-
package-lock.json
7-
functions/venv
8-
functions/__pycache__
3+
/.pnp
4+
.pnp.js
5+
6+
# Testing
7+
/coverage
8+
9+
# Next.js
10+
/.next/
11+
/out/
12+
13+
# Production
14+
/build
15+
16+
# Misc
17+
.DS_Store
18+
*.pem
19+
20+
# Debug
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
25+
# Local env files
26+
.env*.local
27+
28+
# Vercel
29+
.vercel
30+
31+
# TypeScript
32+
*.tsbuildinfo
33+
next-env.d.ts
34+
35+
# Extension files
36+
/extensions/
37+
harmonydata.github.io.code-workspace

README.md

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,123 @@ The alternative method is to call the globally available function `createHarmony
118118
You can raise an issue in the [issue tracker](https://github.com/harmonydata/harmony/issues), and you can open a [pull request](https://github.com/harmonydata/harmony/pulls).
119119

120120
Please contact us at https://harmonydata.ac.uk/contact or write to thomas@fastdatascience.com if you would like to be involved in the project.
121+
122+
# Harmony Browser Extensions
123+
124+
Browser extensions for sending selected text to Harmony. Available for Chrome, Firefox, and Safari.
125+
126+
## Features
127+
128+
- Right-click to send selected text to Harmony
129+
- Popup interface for pasting text from PDFs
130+
- Seamless integration with Harmony Data platform
131+
- Cross-browser support
132+
133+
## Development
134+
135+
The extensions are built using vanilla JavaScript and browser-specific Extension APIs. Each browser extension is located in its own directory:
136+
137+
- `extensions/chrome/`: Chrome extension
138+
- `extensions/firefox/`: Firefox add-on
139+
- `extensions/safari/`: Safari extension
140+
141+
### Common Components
142+
143+
Each extension shares similar core functionality:
144+
- Context menu integration
145+
- Popup interface
146+
- Text selection handling
147+
- PDF text extraction
148+
149+
### Local Development
150+
151+
1. Clone the repository:
152+
```bash
153+
git clone https://github.com/harmonydata/harmony-browser-extension.git
154+
cd harmony-browser-extension
155+
```
156+
157+
2. Install dependencies:
158+
```bash
159+
npm install
160+
```
161+
162+
3. Load the extension in your browser:
163+
164+
**Chrome:**
165+
- Open Chrome and go to `chrome://extensions/`
166+
- Enable "Developer mode"
167+
- Click "Load unpacked" and select the `extensions/chrome` directory
168+
169+
**Firefox:**
170+
- Open Firefox and go to `about:debugging`
171+
- Click "This Firefox" on the left
172+
- Click "Load Temporary Add-on"
173+
- Select the `extensions/firefox/manifest.json` file
174+
175+
**Safari:**
176+
- Open Safari and go to Safari > Settings > Extensions
177+
- Enable "Developer mode"
178+
- Click "Load Extension"
179+
- Select the `extensions/safari` directory
180+
181+
## Publishing
182+
183+
The extensions are automatically published to their respective stores when changes are pushed to the main branch. This is handled by GitHub Actions.
184+
185+
### Chrome Web Store
186+
187+
1. Go to the [Chrome Web Store Developer Dashboard](https://chrome.google.com/webstore/devconsole)
188+
2. Create a new item or select your existing extension
189+
3. Get your Extension ID from the URL
190+
4. Go to the "API Access" tab
191+
5. Create a new API key:
192+
- Click "Create new credentials"
193+
- Choose "Chrome Web Store API"
194+
- Save the Client ID and Client Secret
195+
196+
### Firefox Add-ons
197+
198+
1. Go to the [Firefox Add-ons Developer Hub](https://addons.mozilla.org/developers/)
199+
2. Create a new add-on or select your existing one
200+
3. Get your Add-on ID
201+
4. Generate API credentials in the Developer Hub
202+
203+
### Safari Extensions
204+
205+
1. Go to the [Apple Developer Portal](https://developer.apple.com)
206+
2. Create a new Safari extension or select your existing one
207+
3. Get your Extension ID
208+
4. Generate API credentials in the Developer Portal
209+
210+
### Configuring GitHub Secrets
211+
212+
Add the following secrets to your GitHub repository (Settings > Secrets and variables > Actions):
213+
214+
**Chrome:**
215+
- `CHROME_EXTENSION_ID`
216+
- `CHROME_CLIENT_ID`
217+
- `CHROME_CLIENT_SECRET`
218+
- `CHROME_REFRESH_TOKEN`
219+
220+
**Firefox:**
221+
- `FIREFOX_EXTENSION_ID`
222+
- `FIREFOX_API_KEY`
223+
- `FIREFOX_API_SECRET`
224+
225+
**Safari:**
226+
- `SAFARI_EXTENSION_ID`
227+
- `SAFARI_API_KEY`
228+
- `SAFARI_API_SECRET`
229+
230+
## Contributing
231+
232+
1. Fork the repository
233+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
234+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
235+
4. Push to the branch (`git push origin feature/amazing-feature`)
236+
5. Open a Pull Request
237+
238+
## License
239+
240+
This project is licensed under the MIT License - see the LICENSE file for details.

plugin/.DS_Store

-6 KB
Binary file not shown.

plugin/Screenshot 640.png

-115 KB
Binary file not shown.

plugin/background.js

Lines changed: 0 additions & 145 deletions
This file was deleted.

plugin/icons/128.png

-7.58 KB
Binary file not shown.

plugin/icons/16.png

-518 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)