Top Related Projects
🖥🔋Web Extension starter to build "Write Once Run on Any Browser" extension
Quick Overview
The chrome-extension-typescript-starter is a boilerplate project for developing Chrome extensions using TypeScript. It provides a basic structure and configuration to help developers quickly set up and start building Chrome extensions with TypeScript support, including hot-reloading for faster development.
Pros
- Streamlines the setup process for Chrome extension development with TypeScript
- Includes hot-reloading for faster development and testing
- Provides a clean, organized project structure
- Includes basic linting and formatting configurations
Cons
- May require some familiarity with TypeScript and Chrome extension development
- Limited documentation within the repository
- Might need additional configuration for more complex extension projects
- Does not include advanced features or components out of the box
Getting Started
-
Clone the repository:
git clone https://github.com/chibat/chrome-extension-typescript-starter.git
-
Install dependencies:
cd chrome-extension-typescript-starter npm install
-
Build the extension:
npm run build
-
Load the extension in Chrome:
- Open Chrome and navigate to
chrome://extensions
- Enable "Developer mode"
- Click "Load unpacked" and select the
dist
folder in the project directory
- Open Chrome and navigate to
-
Start development with hot-reloading:
npm run watch
Competitor Comparisons
🖥🔋Web Extension starter to build "Write Once Run on Any Browser" extension
Pros of web-extension-starter
- Cross-browser compatibility (Chrome, Firefox, Opera, Edge)
- More comprehensive boilerplate with additional features like content scripts and background scripts
- Includes a manifest.json generator for different browser versions
Cons of web-extension-starter
- More complex setup and configuration
- Larger project structure, which may be overwhelming for simple extensions
- Requires more dependencies and has a steeper learning curve
Code Comparison
chrome-extension-typescript-starter:
import './popup.css';
const nameElement = document.querySelector('#name') as HTMLInputElement;
const greetElement = document.querySelector('#greet') as HTMLParagraphElement;
nameElement.addEventListener('input', () => {
greetElement.textContent = `Hello, ${nameElement.value}!`;
});
web-extension-starter:
import { browser } from 'webextension-polyfill-ts';
browser.runtime.onInstalled.addListener((): void => {
console.log('Extension installed');
});
browser.browserAction.onClicked.addListener((): void => {
console.log('Browser action clicked');
});
The chrome-extension-typescript-starter example shows a simple popup interaction, while web-extension-starter demonstrates cross-browser compatibility using the webextension-polyfill-ts library for browser APIs.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Chrome Extension TypeScript Starter
Chrome Extension, TypeScript and Visual Studio Code
Prerequisites
- node + npm (Current Version)
Option
Includes the following
- TypeScript
- Webpack
- React
- Jest
- Example Code
- Chrome Storage
- Options Version 2
- content script
- count up badge number
- background
Project Structure
- src/typescript: TypeScript source files
- src/assets: static files
- dist: Chrome Extension directory
- dist/js: Generated JavaScript files
Setup
npm install
Import as Visual Studio Code project
...
Build
npm run build
Build in watch mode
terminal
npm run watch
Visual Studio Code
Run watch mode.
type Ctrl + Shift + B
Load extension to chrome
Load dist
directory
Test
npx jest
or npm run test
Top Related Projects
🖥🔋Web Extension starter to build "Write Once Run on Any Browser" extension
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot