Compare commits

...
9 Commits
Author SHA1 Message Date
go0p 103a40fdf5 update v0.0.6 2025-03-14 14:21:22 +08:00
go0p 4a99b773be disable xml document 2025-03-10 15:17:43 +08:00
go0p 7fe4731b91 update 0.0.5 2025-03-07 17:23:14 +08:00
go0p 08af08c9a8 del 127 2025-03-07 17:21:32 +08:00
go0p e4b2b90507 Refactor proxy panel UI with enhanced interactivity and drag functionality 2025-03-07 17:05:53 +08:00
go0p 82d1c066cd update version 2025-03-07 14:50:07 +08:00
go0p 2481b22d8e Improve proxy initialization with last used proxy restoration 2025-03-07 14:49:19 +08:00
go0p 6013a7ae4e Bump extension version to 0.0.2 2025-03-05 16:28:24 +08:00
go0p 8742711b68 Improve ProxySwitch menu item visual feedback with selected state indicators 2025-03-05 16:16:46 +08:00
6 changed files with 846 additions and 602 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Yakit Chrome Endpoint",
"version": "0.0.1",
"version": "0.0.6",
"description": "A Endpoint for Yakit MITM or more",
"options_ui": {
"page": "proxy/options.html",
@@ -24,7 +24,7 @@
},
"content_scripts": [
{
"matches": ["http://mitm/"],
"matches": ["<all_urls>","http://mitm/"],
"run_at": "document_start",
"js": ["proxy/content.js"]
}
+13 -6
View File
@@ -290,6 +290,16 @@ async function checkAndSetInitialProxy() {
// 确保默认配置存在
await ProxySettings.setDefaultConfigs();
// 获取上次保存的代理配置
const lastProxy = await proxyStore.getCurrentProxy();
if (lastProxy) {
// 如果有上次的配置,恢复它
console.log('Restoring last proxy configuration:', lastProxy);
await handleSetProxyConfig(lastProxy, () => {});
return;
}
// 获取当前的代理设置
const settings = await getProxySettings();
console.log('Current proxy settings:', settings);
@@ -338,7 +348,7 @@ async function checkAndSetInitialProxy() {
}
}
// 如果没有检测到代理或已存在配置,则设置为系统代理
// 如果没有之前的配置也没有检测到代理,才设置为系统代理
await handleSetProxyConfig({
id: 'system',
name: '[系统代理]',
@@ -346,9 +356,6 @@ async function checkAndSetInitialProxy() {
enabled: true
}, () => {});
// 设置认证监听
await ProxyAuth.setupAuthListener();
} catch (error) {
console.error('Error during initialization:', error);
}
@@ -356,10 +363,10 @@ async function checkAndSetInitialProxy() {
// 修改 setupProxyHandlers 函数
export function setupProxyHandlers() {
// 设置代理错误处理和认证
// 设置代理错误处理
ProxyAuth.setupErrorHandler();
// 设置认证监听
ProxyAuth.setupAuthListener();
// 设置代理请求监听器
setupProxyRequestListener();
+820 -587
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -43,9 +43,9 @@ export class ProxySettings {
]);
}
// 确保日志存储已初始化
const logs = await proxyStore.getLogs(); // 使用 getLogs 而不是 getProxyLogs
const logs = await proxyStore.getLogs();
if (!logs || logs.length === 0) {
await proxyStore.clearLogs(); // 初始化日志存储
await proxyStore.clearLogs();
}
}
}
+8 -4
View File
@@ -237,21 +237,25 @@ export const ProxySwitch: React.FC<ProxySwitchProps> = () => {
const menuItems: MenuProps['items'] = [
...FIXED_MODES.map(mode => ({
key: mode.key,
icon: <span className="menu-icon" style={{ color: mode.color }}>{mode.icon}</span>,
label: mode.name,
icon: <span className="menu-icon" style={{
color: currentMode === mode.key ? 'var(--yakit-primary)' : mode.color
}}>{mode.icon}</span>,
label: `${mode.name}${currentMode === mode.key ? ' ✅' : ''}`,
className: `${currentMode === mode.key ? 'menu-item-selected' : ''} ${isLoading ? 'menu-item-loading' : ''}`,
title: mode.name.replace(/[\[\]]/g, '')
})),
{ type: 'divider' },
...customProxies.map(proxy => ({
key: proxy.key,
icon: <span className="menu-icon" style={{ color: proxy.color }}>
icon: <span className="menu-icon" style={{
color: currentMode === proxy.key ? 'var(--yakit-primary)' : proxy.color
}}>
{proxy.config.proxyType === 'pac_script' ? '📜' : <GlobalOutlined />}
</span>,
label: <span style={{
color: currentMode === proxy.key ? 'var(--yakit-primary)' : 'inherit',
opacity: isLoading ? 0.7 : 1
}}>{proxy.name}</span>,
}}>{proxy.name}{currentMode === proxy.key ? ' ✅' : ''}</span>,
className: `${currentMode === proxy.key ? 'menu-item-selected' : ''} ${isLoading ? 'menu-item-loading' : ''}`,
title: proxy.config.scheme
? `${proxy.config.scheme.toUpperCase()} ${proxy.config.host}:${proxy.config.port}`
@@ -107,7 +107,7 @@ export const ProxySettings: React.FC<ProxySettingsProps> = ({
// 处理固定代理服务器模式
const bypassList = values.bypassList
? values.bypassList.split('\n').map(line => line.trim()).filter(line => line.length > 0)
: ["localhost", "127.0.0.1"];
: [""];
updatedConfig = {
id: editingConfig.id,