A modern Naver Whale extension boilerplate built with Vite, React, TypeScript, Tailwind CSS, and shadcn/ui.
├── public/
│ └── manifest.json # Whale extension manifest (v3)
├── src/
│ ├── popup/ # Extension popup UI
│ │ ├── Popup.tsx
│ │ └── index.tsx
│ ├── sidebar/ # Whale sidebar UI (Whale-specific)
│ │ ├── Sidebar.tsx
│ │ └── index.tsx
│ ├── options/ # Extension options page
│ │ ├── Options.tsx
│ │ └── index.tsx
│ ├── background/ # Background service worker
│ │ └── index.ts
│ ├── content/ # Content script
│ │ └── index.ts
│ └── index.css # Global styles with Tailwind
├── popup.html # Popup HTML entry point
├── sidebar.html # Sidebar HTML entry point (Whale-specific)
├── options.html # Options page HTML entry point
└── vite.config.ts # Vite configuration for multi-page build
- Manifest V3: Latest extension manifest version
- Whale Sidebar: Built-in sidebar support (Whale-specific feature)
- Chrome API Compatible: Chrome extension APIs work in Whale browser
- React 18: Modern React with TypeScript
- Tailwind CSS: Utility-first CSS framework
- shadcn/ui: Beautiful, accessible component library
- Vite: Fast build tool and dev server
- TypeScript: Full type safety with Whale & Chrome types
- Hot Module Replacement: Fast development experience
npm install
npm run devnpm run buildThe extension will be built to the dist/ folder.
- Run
npm run buildto create the production build - Open Whale browser and go to
whale://extensions/ - Enable "Developer mode" in the top right
- Click "Load unpacked extension"
- Select the
dist/folder
The UI that appears when users click the extension icon in the toolbar.
The sidebar UI unique to Whale browser. Provides a persistent side panel for your extension.
Features:
- Always accessible alongside web pages
- Can display current page URL
- Quick actions integration
- Navigation bar support
A full-page interface for extension settings. Access via right-click on extension icon → Options.
Runs in the background and handles events like:
- Extension installation
- Messages from content scripts
- Tab updates
- Browser events
Runs in the context of web pages and can:
- Access and modify the DOM
- Communicate with the background script
- Inject UI elements into pages
The extension uses whale.storage.sync for settings persistence. Example usage can be found in src/options/Options.tsx.
Note: Whale browser supports both whale.* and chrome.* APIs, so you can use chrome.storage.sync as well.
- Popup ↔ Background: Use
whale.runtime.sendMessage() - Sidebar ↔ Background: Use
whale.runtime.sendMessage() - Content ↔ Background: Use
whale.runtime.sendMessage() - Background → Content: Use
whale.tabs.sendMessage()
Add icon files to the public/ folder:
icon-16.png(16x16px)icon-48.png(48x48px)icon-128.png(128x128px)
Edit public/manifest.json to add required permissions:
{
"permissions": [
"storage",
"activeTab",
"tabs"
],
"host_permissions": [
"https://*.example.com/*"
]
}Add shadcn/ui components:
npx shadcn@latest add button
npx shadcn@latest add cardThe sidebar is a unique Whale browser feature that provides a persistent side panel. Configured in manifest.json:
"sidebar_action": {
"default_page": "sidebar.html",
"default_icon": { "16": "icon-16.png" },
"default_title": "Whale Sidebar",
"use_navigation_bar": true
}- window.open extensions:
whale-sidebar,whale-space,whale-mobile,web-app - BarcodeDetector API: Built-in barcode recognition
- Media Session API: Integration with global media controls
- Naver Whale Extension Docs
- Chrome Extension Docs (Chrome APIs work in Whale)
- Manifest V3 Migration Guide
- Vite Documentation
- Tailwind CSS
- shadcn/ui