░█▀█░█▀▄░█▀█░█▄█░█▀█░▀█▀░▀█▀░█░█░▀█▀░█▀▀
░█▀▀░█▀▄░█░█░█░█░█▀▀░░█░░░█░░█▀█░░█░░▀▀█
░▀░░░▀░▀░▀▀▀░▀░▀░▀░░░░▀░░░▀░░▀░▀░▀▀▀░▀▀▀
A Chrome extension created for the Google Chrome Built-in AI Challenge that seamlessly integrates AI capabilities into your browsing experience.
PromptThis.AI.mp4
In today's digital landscape, AI tools have become essential for many tasks, but their integration into our daily workflow remains fragmented and inefficient. Users frequently find themselves:
- Switching between multiple tabs or applications to access AI features
- Repeatedly copying and pasting text back and forth between AI tools
- Writing similar prompts over and over for common tasks, like "correct this" or "summarize that"
This context-switching not only breaks concentration but also significantly reduces productivity.
PromptThis.AI seamlessly integrates AI capabilities directly into your browser's context menu, making AI assistance just a right-click away. Key features include:
- Custom AI Tasks: Define your own AI-powered tasks that appear in the context menu
- Dynamic Prompts: Use variables like selected text, current URL, or page language in your prompts
- Context-Aware: Tasks can be configured to appear only on specific websites or languages
- Seamless Integration: AI appears right alongside your work in a convenient sidepanel - no tab switching needed
- Right-click on any page to access your custom AI tasks
- Select a task from the context menu
- The prompt appears in a side panel with your selected text automatically inserted
- Edit the prompt if needed and submit
- Copy or directly insert the AI-generated result backinto your work
Here are some practical use cases for AI tasks:
Correct This Text: Quickly correct any selected text, available on any webpage.
- Name: Correct This Text
- Prompt: Correct this text for grammar and spelling mistakes:
{{selection}}
Rewrite This Email: Write an email in your own words and make it more formal before sending, available only on Gmail.
- Name: Rewrite This Email
- Prompt: Rewrite this email to be more formal:
{{selection}}
- Options:
- RewriterTone:
More Formal
- RewriterTone:
- Conditions:
- URL contains
mail.google.com
- HasSelection is
true
- URL contains
Summarize This Article: Turn any text into bullet points, available on any webpage.
- Name: Summarize This Article
- Prompt: Summarize this text in bullet points:
{{selection}}
- Options:
- SummaryType:
Key Points
- SummaryLength:
Short
- SummaryType:
- Conditions:
- HasSelection is
true
- HasSelection is
Explain This Word: Explain any unknown word, available only on English pages.
- Name: Explain This Word
- Prompt: Explain this word or phrase in English:
{{selection}}
- Conditions:
- Language matches
/^en/
- HasSelection is
true
- Language matches
Shorten This Tweet: Shorten your tweet to 300 characters or less, available only on Twitter/X and Bluesky.
- Name: Shorten This Tweet
- Prompt: Shorten this tweet to 300 characters or less:
{{selection}}
- Conditions:
- URL matches
/x\.com|bsky\.app/
- HasSelection is
true
- URL matches
The extensions currently uses Prompt API (type: languageModel
), the Summarizer API (type: summarizer
), and the Rewriter API (type: rewriter
).
Each task has the following mandatory fields:
Field | Description | Type | Default |
---|---|---|---|
Name |
The name of the task which appears in the context menu | string |
- |
Prompt |
The prompt text with placeholder variables | string |
- |
Type |
The type of the task which determines which AI API to use | languageModel | summarizer | rewriter |
languageModel |
Conditions control when a task should be shown in the context menu. They are optional and if no conditions are provided, the task will be shown in the context menu on all pages. If multiple conditions are provided, the task will be shown only if all conditions are met.
The following conditions are available:
Field | Description | Type | Default |
---|---|---|---|
URL |
The task should only be shown on specific URLs | string | Regex |
- |
Language |
The task should only be shown on specific languages | string | Regex |
- |
HasSelection |
The task should only be shown if there is a text selection on the page | boolean |
false |
Options control the behavior of the task when it is selected or executed.
The following options are available:
Field | Description | Type | Default |
---|---|---|---|
AutoSubmit |
Whether the task should be submitted automatically when it is selected from the context menu | boolean |
false |
LanguageModelTemperature |
Temperature of the language model, if type is languageModel |
number |
0.7 |
LanguageModelTopK |
Top-k of the language model, if type is languageModel |
number |
8 |
SummaryType |
Type of the summary, if type is summarizer |
Key Points | Teaser | Headline | TL;DR |
Key Points |
SummaryFormat |
Format of the summary, if type is summarizer |
Markdown | Plain Text |
Markdown |
SummaryLength |
Length of the summary, if type is summarizer |
Short | Medium | Long |
Short |
RewriterTone |
Tone of the rewriter, if type is rewriter |
As Is | More Formal | More Casual |
As Is |
RewriterFormat |
Format of the rewriter, if type is rewriter |
As Is | Markdown | Plain Text |
As Is |
RewriterLength |
Length of the rewriter, if type is rewriter |
As Is | Shorter | Longer |
Shorter |
The extension is currently only available for Google Chrome Canary.
- Clone this repository to your local machine.
- Run
pnpm install
to install the dependencies. - Run
pnpm run build
to build the extension to thedist
folder. - Open Chrome and navigate to
chrome://extensions/
. - Enable "Developer mode" if it is not already enabled.
- Click "Load unpacked" and select the
dist
folder inside the cloned repository.
Note: The /dist
folder was committed to this remote repository for a quick start. That means you can skip the steps 2 and 3 above.
Open the extension by clicking on the PromptThis.AI
icon in the Chrome toolbar.
The extensions comes with a default set of tasks, but you can also add your own tasks by clicking on the Add Prompt
button in the extension sidepanel or right-clicking on any page and select Add Prompt
.
For quick one-off tasks, the Prompt This
context menu option is always available on any page.
While the current version already supports many use cases through customizations (conditions, options, variables), I have lots of ideas for making it even more powerful. Here are my ideas for new features:
Conditions control when a task appears in the context menu on a right-clicked element:
IsEditable
to check if the right-clicked element is an editable text inputIsImage
to check if the right-clicked element is an imageCssSelector
to check if the right-clicked element matches a CSS selectorHasMetaTag
to check if page has a meta tag with a given name and value
Options control the behavior of a task when it is selected or executed:
AutoSelect
to automatically select the content of the right-clicked elementAutoInsert
to insert the generated text right back into the right-clicked elementAutoCopy
to copy the generated text into the clipboard
Variables make prompts dynamic:
Cursor
to control where the cursor is placed inside the prompt input when task is openedTextContent
orHtmlContent
to insert the text or html content of the right-clicked element
Imagine proofreading any text you type in a textarea, on any site, without having to select, copy, or paste anything.
Here's how these features could work together in a real-world scenario:
CssSelector
condition liketextarea:read-write
to show the task only on editable textareasAutoSelect
option to automatically grab the textarea's content without having to select itAutoSubmit
option to execute the task immediatelyAutoInsert
option to put the corrected text right back where you started
The result? Proofreading any text with just two clicks: right-click and select the task.
MIT