- Fetches the text content of the active tab
- Sends the content to the Perplexity API for abstract and keyword generation
- Displays the generated abstract and keywords in the extension popup
- Generates an APA citation for the webpage based on the title, author, and publication date
- Allows copying the generated abstract, keywords, and citation in Markdown, HTML, or plain text format with the click of a button
- Allows customization of API key, model, and temperature through the options page.
- Supports internationalization (i18n) for English, Spanish, and French languages.
- Allows fine-tuning the abstract generation by adjusting the top-p, top-k, max-tokens, frequency-penalty, and presence-penalty parameters.
Install the latest version of this add-on by clicking the link below, or you can download the latest version from the releases page.
- Clone this repository or download the source code
- Open Firefox and go to
about:debugging
- Click on "This Firefox" in the left sidebar
- Click on the "Load Temporary Add-on" button
- Navigate to the directory where you cloned/downloaded the source code and select the
manifest.json
file - The extension should now be loaded and visible in your extensions list
- Navigate to a web page you want to generate an abstract for
- Click on the extension icon in the Firefox toolbar
- Click the "Resume" button in the popup to fetch the page content and send it to the Perplexity API
- The generated abstract, keywords, and APA citation will be displayed in the popup textarea
- Click on the "Copy Markdown", "Copy HTML", or "Copy Text" button to copy the generated content in the desired format
- To change settings like your API key, model, or temperature, click the "Settings" button to open the options page
The extension uses the following default configuration:
- API Key: 'pplx-xxxxxxxxxxx' (replace with your own or it won't work)
- Model: 'sonar-medium-chat'
- Temperature: 1
- All other parameters are undefined by default.
- Please take account that top-k can't be defined at the same time as top-p, and vice versa.
- Same with presence-penalty and frequency-penalty.
You can change these settings on the options page.
- ✅ Add support for internationalization (i18n)
- ✅ Add support for generating abstracts from selected text on the page
- ✅ Add support for generating keywords from the content
- ✅ Add support for generating APA citations for the page
- ✅ Add support for copying the generated abstract, keywords, and citation in different formats
- ✅ Write a suitable CONTRIBUTING.md file for the project 😉
- ✅ Add a tab for About and Credits
- 🚧 Improve the UI/UX of the extension popup and options page
- 🚧 Add more customization options and features
- 🔜 Recover and save last abstract and keywords generated for a given page
- 🔜 Add support to export lists of abstracts and keywords to clipboard
- 🔜 Add support to write the abstract and keywords to a new tab
- 🔜 Add support for generating abstracts from multiple tabs at once
- 🔜 Add support for more API models and parameters
- 🔜 Add more languages to the supported locales
- 🔜 Improve error handling and user feedback
quick-abstract/
│
├── icons/
│ ├── icon-16.png
│ ├── icon-32.png
│ ├── icon-48.png
│ ├── icon-64.png
│ ├── icon-96.png
│ ├── icon-128.png
│ └── icon.png
│
├── _locales/
│ ├── en/
│ │ └── messages.json
│ ├── es/
│ │ └── messages.json
│ └── fr/
│ └── messages.json
│
├── lib/
│ └── purify.min.js
│
├── background/
│ └── background.js
│
├── options/
│ ├── options.html
│ ├── options.js
│ └── options.css
│
├── popup/
│ ├── extension.html
│ ├── extension.js
│ └── popup.js
│
├── style/
│ └── style.css
│
├── CONTRIBUTING.md
├── LICENSE
├── manifest.json
└── README.md
manifest.json
: The extension manifest file defining metadata, permissions, and scriptsLICENSE
: License file for the projectREADME.md
: Readme file with information about the extensionCONTRIBUTING.md
: Contributing guidelines for the projectpopup/extension.html
: The HTML structure for the extension popuppopup/extension.js
: JavaScript for handling tabs interactionspopup/popup.js
: JavaScript handling popup interactions and API callsbackground/background.js
: Background script for handling API requests and responsesoptions/options.html
: Options page for configuring API key, model, and temperatureoptions/options.js
: JavaScript for handling options page interactions and storageoptions/options.css
: Stylesheet for the options pagestyle/style.css
: Stylesheet for the extensionicons/
: Directory containing the extension icons in various sizes_locales/
: Directory containing language-specific message fileslib/
: Directory containing third-party libraries used in the extension (DOMPurify by now)
This extension relies on the Perplexity AI API. You need to sign up for an API key at https://www.perplexity.ai/ to use this extension. You can read the API documentation here.
This extension now supports internationalization, allowing users to interact with it in their preferred language. The following languages are currently supported:
- English (default)
- Spanish
- French
To add support for more languages, follow the steps outlined in the "Adding New Languages" section below.
The language-specific message files are located in the _locales
directory, organized by locale code. Each locale directory contains a messages.json
file that defines the localized strings for that language.
Example:
_locales/en/messages.json
: English messages_locales/es/messages.json
: Spanish messages_locales/fr/messages.json
: French messages
The extension uses the browser.i18n
API to retrieve localized strings in the JavaScript code. The getMessage()
function is used to get the localized string for a given message ID.
Example:
const localizedString = browser.i18n.getMessage('messageId');
To use localized strings in HTML files, you can use the MSG_messageId syntax in the HTML attributes or content. Example:
<button title="__MSG_buttonTitle__">Click me</button>
To add support for a new language, follow these steps:
- Create a new directory in the _locales directory with the locale code of the language (e.g., 'de' for German).
- Create a messages.json file inside the new locale directory.
- Add the localized strings for the new language in the messages.json file, following the same format as the existing language files.
- Update the list of supported languages in the README.md file.
With the i18n support, the Perplexity Abstract Creator extension can now reach a wider audience and provide a localized user experience.
This project is open-source and available under the MIT License. Feel free to use, modify, and distribute the code as you see fit.
- Perplexity AI for providing the AI API used in this extension.
- Mozilla for the extensive documentation and resources on developing Firefox extensions.
- DOMPurify by @Cure53 for the HTML sanitization library used in the extension.