mirror of
https://github.com/yaklang/yaklang-chrome-extension.git
synced 2026-09-22 03:10:43 +08:00
Update project structure and dependencies; add architecture documentation and improve build scripts. Introduce new versioning and permissions for enhanced functionality.
This commit is contained in:
+49
-13
@@ -4,28 +4,64 @@ import { defineConfig } from 'wxt';
|
||||
export default defineConfig({
|
||||
srcDir: 'src',
|
||||
modules: ['@wxt-dev/module-react'],
|
||||
manifest: {
|
||||
name: 'Yaklang 代理管理',
|
||||
description: '一个用于快速切换浏览器代理设置的扩展',
|
||||
version: '0.1.0',
|
||||
manifest: ({ mode, browser }) => ({
|
||||
name: 'Yakit Browser Agent',
|
||||
description: 'Yakit 浏览器安全测试工具与 AI 上下文桥接',
|
||||
version: '0.2.0',
|
||||
action: {
|
||||
default_title: 'Yakit Browser Agent',
|
||||
},
|
||||
options_ui: {
|
||||
page: 'options.html',
|
||||
open_in_tab: true,
|
||||
},
|
||||
storage: {
|
||||
managed_schema: 'managed-storage-schema.json',
|
||||
},
|
||||
permissions: [
|
||||
'proxy',
|
||||
'storage',
|
||||
'tabs'
|
||||
'tabs',
|
||||
'scripting',
|
||||
'cookies',
|
||||
'declarativeNetRequest',
|
||||
'webRequest',
|
||||
'webNavigation',
|
||||
...(browser === 'firefox' ? ['webRequestBlocking'] : ['webRequestAuthProvider']),
|
||||
...(browser !== 'firefox' && ['production', 'store', 'enterprise'].includes(mode) ? ['userScripts'] : []),
|
||||
],
|
||||
optional_permissions: ['nativeMessaging'],
|
||||
host_permissions: [
|
||||
'<all_urls>'
|
||||
],
|
||||
browser_specific_settings: {
|
||||
gecko: {
|
||||
id: '[email protected]',
|
||||
strict_min_version: '140.0',
|
||||
data_collection_permissions: {
|
||||
required: ['authenticationInfo', 'browsingActivity', 'websiteActivity', 'websiteContent'],
|
||||
},
|
||||
},
|
||||
},
|
||||
icons: {
|
||||
'16': 'icon/icon16.png',
|
||||
'48': 'icon/icon48.png',
|
||||
'128': 'icon/icon128.png',
|
||||
},
|
||||
web_accessible_resources: [
|
||||
{
|
||||
resources: ['yak.svg'],
|
||||
matches: ['<all_urls>']
|
||||
}
|
||||
resources: [...((mode === 'store' || (browser !== 'firefox' && mode === 'production')) ? [] : ['page-main-world.js']), 'floating.html', 'yak.svg', 'icon/yakitlogo.png'],
|
||||
matches: ['<all_urls>'],
|
||||
use_dynamic_url: true,
|
||||
},
|
||||
],
|
||||
icons: {
|
||||
"16": "icon/icon16.png",
|
||||
"48": "icon/icon48.png",
|
||||
"128": "icon/icon128.png"
|
||||
...(browser !== 'firefox' && ['production', 'store'].includes(mode) ? { minimum_chrome_version: '138' } : {}),
|
||||
}),
|
||||
hooks: {
|
||||
'entrypoints:resolved': (wxt, entrypoints) => {
|
||||
if (!(wxt.config.mode === 'store' || (wxt.config.browser !== 'firefox' && wxt.config.mode === 'production'))) return;
|
||||
const directEvalEntrypoint = entrypoints.find((entrypoint) => entrypoint.name === 'page-main-world');
|
||||
if (directEvalEntrypoint) directEvalEntrypoint.skipped = true;
|
||||
},
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user