加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
manifest.firefox.config.ts 1.60 KB
一键复制 编辑 原始数据 按行查看 历史
Muhammad Ubaid Raza 提交于 2024-06-10 23:10 . enable popup default
import { defineManifest } from '@crxjs/vite-plugin'
import packageJson from './package.json' assert { type: 'json' }
const { version, name, description, displayName } = packageJson
// Convert from Semver (example: 0.1.0-beta6)
const [major, minor, patch, label = '0'] = version
// can only contain digits, dots, or dash
.replace(/[^\d.-]+/g, '')
// split into version parts
.split(/[.-]/)
export default defineManifest(async (env) => ({
name: env.mode === 'staging' ? `[INTERNAL] ${name}` : displayName || name,
description,
// up to four numbers separated by dots
version: `${major}.${minor}.${patch}.${label}`,
// semver is OK in "version_name"
// version_name: version,
manifest_version: 3,
// browser_specific_settings: {
// gecko: {
// id: '{}',
// strict_min_version: '112.0',
// },
// },
action: {
default_popup: 'src/popup/index.html',
},
background: {
scripts: ['src/background/index.ts'],
type: 'module',
persistent: false,
},
content_scripts: [
{
all_frames: false,
js: ['src/content-script/index.ts'],
matches: ['*://*/*'],
run_at: 'document_end',
},
],
// offline_enabled: false,
host_permissions: [],
permissions: ['storage', 'tabs'],
web_accessible_resources: [
{
matches: ['*://*/*'],
resources: ['src/content-script/index.ts'],
},
{
matches: ['*://*/*'],
resources: ['src/content-script/iframe/index.html'],
},
],
icons: {
16: 'src/assets/logo.png',
24: 'src/assets/logo.png',
32: 'src/assets/logo.png',
128: 'src/assets/logo.png',
},
}))
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化