Something went wrong. Try again.
(READ ONLY) Margin is an open annotation layer for the internet. Powered by the AT Protocol.
margin.at
extension web atproto comments
Something went wrong. Try again.
TypeScript
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100import { defineConfig } from 'wxt';import { cp } from 'fs/promises';import { existsSync } from 'fs';import { resolve } from 'path';
export default defineConfig({ srcDir: 'src', modules: ['@wxt-dev/module-react'], manifestVersion: 3, hooks: { 'build:done': async (wxt) => { const publicDir = resolve(__dirname, 'public'); const outDir = wxt.config.outDir;
if (existsSync(publicDir)) { await cp(publicDir, outDir, { recursive: true }); } }, }, manifest: ({ browser }) => { const basePermissions = ['storage', 'activeTab', 'tabs', 'cookies', 'contextMenus']; const chromePermissions = [...basePermissions, 'sidePanel'];
return { name: 'Margin', description: 'Annotate and highlight any webpage, with your notes saved to the decentralized AT Protocol.', permissions: browser === 'firefox' ? basePermissions : chromePermissions, host_permissions: ['https://margin.at/*', '*://*/*'], icons: { 16: '/icons/icon-16.png', 32: '/icons/icon-32.png', 48: '/icons/icon-48.png', 128: '/icons/icon-128.png', }, commands: { 'open-sidebar': { suggested_key: { default: 'Alt+M', mac: 'Alt+M', }, description: 'Open Margin sidebar', }, 'annotate-selection': { suggested_key: { default: 'Alt+A', mac: 'Alt+A', }, description: 'Annotate selected text', }, 'highlight-selection': { suggested_key: { default: 'Alt+H', mac: 'Alt+H', }, description: 'Highlight selected text', }, 'bookmark-page': { suggested_key: { default: 'Alt+B', mac: 'Alt+B', }, description: 'Bookmark current page', }, }, action: { default_title: 'Margin', default_popup: 'popup.html', default_icon: { 16: '/icons/icon-16.png', 32: '/icons/icon-32.png', 48: '/icons/icon-48.png', 128: '/icons/icon-128.png', }, }, ...(browser === 'chrome' ? { side_panel: { default_path: 'sidepanel.html', }, } : { sidebar_action: { default_title: 'Margin', default_panel: 'sidepanel.html', }, browser_specific_settings: { gecko: { id: 'hello@margin.at', strict_min_version: '140.0', data_collection_permissions: { required: ['none'], }, }, }, }), }; },});