This Chrome extension allows you to send selected text to Harmony with a right-click. For PDFs, use the popup to paste your selected text.
- Right-click to send selected text to Harmony
- Popup interface for pasting text from PDFs
- Seamless integration with Harmony Data platform
The extension is built using vanilla JavaScript and Chrome Extension APIs. The main components are:
manifest.json
: Extension configurationbackground.js
: Service worker for handling context menu and messagingpopup.html/js
: UI for the extension popupicons/
: Extension icons in various sizes
-
Clone the repository:
git clone https://github.com/harmonydata/harmonydata-chrome-extension.git cd harmonydata-chrome-extension
-
Install dependencies:
npm install
-
Load the extension in Chrome:
- Open Chrome and go to
chrome://extensions/
- Enable "Developer mode"
- Click "Load unpacked" and select the extension directory
- Open Chrome and go to
The extension is automatically published to the Chrome Web Store when changes are pushed to the main branch. This is handled by GitHub Actions.
- Go to the Chrome Web Store Developer Dashboard
- Create a new item or select your existing extension
- Get your Extension ID from the URL (it's the long string of letters and numbers)
- Go to the "API Access" tab
- Create a new API key:
- Click "Create new credentials"
- Choose "Chrome Web Store API"
- Save the Client ID and Client Secret
Add the following secrets to your GitHub repository (Settings > Secrets and variables > Actions):
EXTENSION_ID
: Your Chrome extension IDCLIENT_ID
: Chrome Web Store API Client IDCLIENT_SECRET
: Chrome Web Store API Client SecretREFRESH_TOKEN
: OAuth 2.0 Refresh Token
To get the refresh token:
- Go to Google Cloud Console
- Select your project
- Go to APIs & Services > Credentials
- Create an OAuth 2.0 Client ID
- Use the OAuth 2.0 Playground to get a refresh token:
- Set the OAuth 2.0 configuration
- Authorize APIs using your client ID
- Exchange authorization code for tokens
- Copy the refresh token
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Open chrome extensions settings: "chrome://extensions" Toggle "Developer mode" Click the new "Load unpacked" button Select the chrome folder. When the extension appears is it most useful to pin it to allow the popover features