代码拉取完成,页面将自动刷新
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',
},
}))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。