This Chrome extension consists of two files: manifest.json
and background.js
. Here's a breakdown of what each file does:
-
manifest.json
: This file contains metadata about the extension and specifies its permissions and behavior. -
background.js
: This is a service worker that runs in the background. It listens for the creation of new tabs and redirects them to ChatGPT if they're empty new tabs.
To use this extension:
- Create a new directory for your extension.
- Create the two files (
manifest.json
andbackground.js
) in this directory with the content provided above. - Open Chrome and go to
chrome://extensions/
. - Enable "Developer mode" in the top right corner.
- Click "Load unpacked" and select the directory containing your extension files.
Now, when you open a new tab or window, it should automatically redirect to https://chat.openai.com.
Note: This extension will redirect all new tabs to ChatGPT. If you want to keep the ability to use regular new tabs sometimes, you might want to modify the extension to use a specific keyboard shortcut or add an icon that you can click to go to ChatGPT instead.