Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A comprehensive collection of browser extension examples

License

Notifications You must be signed in to change notification settings

extension-js/examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Powered by Extension.js CI chromium firefox discord

Extension.js Examples

A collection of browser extension examples

This repository contains browser extension examples built with Extension.js. Each example demonstrates different patterns, frameworks, and use cases for building cross-browser extensions.

Web standards and framework support

ESNext
Try out
TypeScript
Try out
WASM
(soon)
React
Try out
Vue
Try out
Svelte
Try out
Preact
Try out

Examples

Sidebar

javascript example icon JavaScript Example

JavaScript-based extension with a sidebar panel. Adds a sidebar with a simple page.

Repository examples/javascript javascript screenshot
Version3.0.0
ContextContent Script, Sidebar, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
react example icon React Example

React-based extension with a sidebar panel. Adds a sidebar with a simple page.

Repository examples/react react screenshot
Version3.0.0
ContextContent Script, Sidebar, Background
JavaScript frameworkReact
CSSCSS
Background included Yes Start with this template ↗
preact example icon Preact Example

Preact-based extension with a sidebar panel. Adds a sidebar with a simple page.

Repository examples/preact preact screenshot
Version3.0.0
ContextContent Script, Sidebar, Background
JavaScript frameworkPreact
CSSCSS
Background included Yes Start with this template ↗
svelte example icon Svelte Example

Svelte-based extension with a sidebar panel. Adds a sidebar with a simple page.

Repository examples/svelte svelte screenshot
Version3.0.0
ContextContent Script, Sidebar, Background
JavaScript frameworkSvelte
CSSCSS
Background included Yes Start with this template ↗
vue example icon Vue Example

Vue.js-based extension with a sidebar panel. Adds a sidebar with a simple page.

Repository examples/vue vue screenshot
Version3.0.0
ContextContent Script, Sidebar, Background
JavaScript frameworkVue
CSSCSS
Background included Yes Start with this template ↗
typescript example icon TypeScript Example

TypeScript-based extension with a sidebar panel. Adds a sidebar with a simple page.

Repository examples/typescript typescript screenshot
Version3.0.0
ContextContent Script, Sidebar, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
sidebar example icon Sidebar Example

Sidebar panel example. Adds a sidebar to the browser with a simple page.

Repository examples/sidebar sidebar screenshot
Version0.0.1
ContextSidebar, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
sidebar-shadcn example icon Sidebar Shadcn Example

React sidebar example using shadcn/ui components. Adds a sidebar panel with a simple React page.

Repository examples/sidebar-shadcn sidebar-shadcn screenshot
Version0.0.1
ContextSidebar, Background
JavaScript frameworkReact
CSSCSS
Background included Yes Start with this template ↗
sidebar-transformers-js example icon Sidebar Transformers JS Example

Sidebar example that runs a small Transformers.js demo inside a side panel.

Repository examples/sidebar-transformers-js sidebar-transformers-js screenshot
Version0.0.1
ContextSidebar, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
extension.js icon Sidebar Monorepo Turbopack Example

Monorepo example with content script and sidebar.

Repository examples/sidebar-monorepo-turbopack sidebar-monorepo-turbopack screenshot
Version0.0.1
ContextContent Script, Sidebar, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗

Action

action example icon Action Example

Action popup example. Opens a toolbar popup with a simple page.

Repository examples/action action screenshot
Version0.0.1
ContextAction, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
action-chatgpt example icon Action ChatGPT Example

React action popup example. Opens a toolbar popup and renders a basic React UI.

Repository examples/action-chatgpt action-chatgpt screenshot
Version0.0.1
ContextAction, Background
JavaScript frameworkReact
CSSCSS
Background included Yes Start with this template ↗
action-locales example icon Action Locales Example

Action popup example demonstrating i18n with _locales and message placeholders.

Repository examples/action-locales action-locales screenshot
Version0.0.1
ContextAction, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗

Content

content example icon Content Example

Content script example that injects a small badge into web pages to demonstrate DOM injection and styling in an extension.

Repository examples/content content screenshot
Version0.0.1
ContextContent Script, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
content-css-modules example icon Content CSS Modules Example

Content script example styled with CSS Modules. Injects a small badge and shows how to scope styles in content scripts.

Repository examples/content-css-modules content-css-modules screenshot
Version0.0.1
ContextContent Script, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
content-custom-font example icon Content Custom Font Example

Content script example that loads custom web fonts. Demonstrates font files and web_accessible_resources setup.

Repository examples/content-custom-font content-custom-font screenshot
Version0.0.1
ContextContent Script, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
content-env example icon Content Env Example

Content script example that reads environment variables (.env) and renders a small UI.

Repository examples/content-env content-env screenshot
Version0.0.1
ContextContent Script, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
content-less example icon Content Less Example

Content script example styled with Less. Injects a small badge and shows how to organize styles with Less in content scripts.

Repository examples/content-less content-less screenshot
Version0.0.1
ContextContent Script, Background
JavaScript frameworkJavaScript
CSSLess
Background included Yes Start with this template ↗
content-less-modules example icon Content Less Modules Example

Content script example using Less with CSS Modules. Injects a small badge and shows how to scope Less styles in content scripts.

Repository examples/content-less-modules content-less-modules screenshot
Version0.0.1
ContextContent Script, Background
JavaScript frameworkJavaScript
CSSLess
Background included Yes Start with this template ↗
content-multi-one-entry example icon Content Multi One Entry Example

Content script example with four scripts listed in one entry. Each script injects a small element.

Repository examples/content-multi-one-entry content-multi-one-entry screenshot
Version0.0.1
ContextContent Script, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
content-multi-three-entries example icon Content Multi Three Entries Example

Content script example split across three entries (2 + 1 + 1). Each script injects a small element.

Repository examples/content-multi-three-entries content-multi-three-entries screenshot
Version0.0.1
ContextContent Script, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
content-preact example icon Content Preact Example

Content script example rendered with Preact. Mounts a small UI inside a Shadow DOM on any page.

Repository examples/content-preact content-preact screenshot
Version0.0.1
ContextContent Script, Background
JavaScript frameworkPreact
CSSCSS
Background included Yes Start with this template ↗
content-react example icon Content React Example

Content script example rendered with React. Mounts a small UI inside a Shadow DOM on any page.

Repository examples/content-react content-react screenshot
Version0.0.1
ContextContent Script, Background
JavaScript frameworkReact
CSSCSS
Background included Yes Start with this template ↗
content-sass example icon Content Sass Example

Content script example styled with Sass. Injects a small badge and shows how to organize styles with Sass in content scripts.

Repository examples/content-sass content-sass screenshot
Version0.0.1
ContextContent Script, Background
JavaScript frameworkJavaScript
CSSSass
Background included Yes Start with this template ↗
content-sass-modules example icon Content Sass Modules Example

A browser extension content script example built with Extension.js using Sass CSS Modules. Demonstrates scoped styles for content scripts with Sass preprocessing.

Repository examples/content-sass-modules content-sass-modules screenshot
Version0.0.1
ContextContent Script, Background
JavaScript frameworkJavaScript
CSSSass
Background included Yes Start with this template ↗
content-svelte example icon Content Svelte Example

Content script example rendered with Svelte. Mounts a small UI inside a Shadow DOM on any page.

Repository examples/content-svelte content-svelte screenshot
Version0.0.1
ContextContent Script, Background
JavaScript frameworkSvelte
CSSCSS
Background included Yes Start with this template ↗
content-typescript example icon Content TypeScript Example

Content script example built with TypeScript. Mounts a small UI and uses typed modules.

Repository examples/content-typescript content-typescript screenshot
Version0.0.1
ContextContent Script, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
content-vue example icon Content Vue Example

Content script example rendered with Vue. Mounts a small UI inside a Shadow DOM on any page.

Repository examples/content-vue content-vue screenshot
Version0.0.1
ContextContent Script, Background
JavaScript frameworkVue
CSSCSS
Background included Yes Start with this template ↗

New

new example icon New Example

New tab page example using plain JavaScript. Renders a simple page you can customize.

Repository examples/new new screenshot
Version0.0.1
ContextNew Tab, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
new-browser-flags example icon New Browser Flags Example

A browser extension example built with Extension.js demonstrating browser-specific features and flags. Shows how to handle browser differences across targets.

Repository examples/new-browser-flags new-browser-flags screenshot
Version0.0.1
ContextContent Script, New Tab, Sidebar, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
new-config-eslint example icon New Config ESLint Example

New tab page example with ESLint configured. Shows how linting is set up in an extension project.

Repository examples/new-config-eslint new-config-eslint screenshot
Version0.0.1
ContextNew Tab, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
new-config-prettier example icon New Config Prettier Example

New tab page example with Prettier configured. Shows how formatting is set up in an extension project.

Repository examples/new-config-prettier new-config-prettier screenshot
Version0.0.1
ContextNew Tab, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
new-config-stylelint example icon New Config Stylelint Example

New tab page example with Stylelint configured. Shows how CSS linting is set up in an extension project.

Repository examples/new-config-stylelint new-config-stylelint screenshot
Version0.0.1
ContextNew Tab, Background
JavaScript frameworkJavaScript
CSSSass
Background included Yes Start with this template ↗
new-crypto example icon New Crypto Example

New tab page example demonstrating basic crypto operations inside an extension.

Repository examples/new-crypto new-crypto screenshot
Version0.0.1
ContextNew Tab, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
new-env example icon New Env Example

New tab page example demonstrating environment variables (.env) in an extension project.

Repository examples/new-env new-env screenshot
Version0.0.1
ContextNew Tab, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
new-less example icon New Less Example

New tab page example styled with Less. Renders a simple page and organizes styles with Less.

Repository examples/new-less new-less screenshot
Version0.0.1
ContextNew Tab, Background
JavaScript frameworkJavaScript
CSSLess
Background included Yes Start with this template ↗
new-preact example icon New Preact Example

New tab page example rendered with Preact. Loads a small Preact app you can extend.

Repository examples/new-preact new-preact screenshot
Version0.0.1
ContextNew Tab, Background
JavaScript frameworkPreact
CSSCSS
Background included Yes Start with this template ↗
new-react example icon New React Example

A browser extension new tab page example built with Extension.js and React. Demonstrates a React-based new tab page with a working build and preview flow.

Repository examples/new-react new-react screenshot
Version0.0.1
ContextNew Tab, Background
JavaScript frameworkReact
CSSCSS
Background included Yes Start with this template ↗
new-react-router example icon New React Router Example

New tab page example using React Router. Shows multiple routes inside the new tab app.

Repository examples/new-react-router new-react-router screenshot
Version0.0.1
ContextNew Tab, Background
JavaScript frameworkReact
CSSCSS
Background included Yes Start with this template ↗
new-sass example icon New Sass Example

New tab page example styled with Sass. Renders a simple page and organizes styles with Sass.

Repository examples/new-sass new-sass screenshot
Version0.0.1
ContextNew Tab, Background
JavaScript frameworkJavaScript
CSSSass
Background included Yes Start with this template ↗
new-svelte example icon New Svelte Example

New tab page example rendered with Svelte. Loads a small Svelte app you can extend.

Repository examples/new-svelte new-svelte screenshot
Version0.0.1
ContextNew Tab, Background
JavaScript frameworkSvelte
CSSCSS
Background included Yes Start with this template ↗
new-typescript example icon New TypeScript Example

A browser extension new tab page example built with Extension.js and TypeScript. Demonstrates a type-safe new tab page with a working build and preview flow.

Repository examples/new-typescript new-typescript screenshot
Version0.0.1
ContextNew Tab, Background
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
new-vue example icon New Vue Example

New tab page example rendered with Vue. Loads a small Vue app you can extend.

Repository examples/new-vue new-vue screenshot
Version0.0.1
ContextNew Tab, Background
JavaScript frameworkVue
CSSCSS
Background included Yes Start with this template ↗

Special folders

special-folders-pages example icon Special Folders Pages Example

Opens a welcome page on extension load, showcasing the pages/ folder.

Repository examples/special-folders-pages special-folders-pages screenshot
Version0.0.1
ContextBackground
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗
special-folders-scripts example icon Special Folders Scripts Example

Demonstrates scripts/ folder organization and how to run standalone scripts via the extension.

Repository examples/special-folders-scripts special-folders-scripts screenshot
Version0.0.1
ContextBackground
JavaScript frameworkJavaScript
CSSCSS
Background included Yes Start with this template ↗

Utilities

init example icon Init Example

A basic browser extension example built with Extension.js. A starting point for developers learning current browser extension tooling.

Repository examples/init init screenshot
Version0.0.1
Context
JavaScript frameworkJavaScript
CSSCSS
Background included No Start with this template ↗

License

MIT (c) Cezar Augusto and the Extension.js Authors.