Compare commits

..
Author SHA1 Message Date
go0p 8de9bbb277 Refactor proxy panel to include a new links tab with dynamic content loading and improved styling for better user interaction 2025-04-02 10:43:35 +08:00
go0p 2f1acfc1dc Add styling for active proxy info to enhance visibility 2025-03-31 15:21:33 +08:00
go0p a8de7e8834 Refactor proxy panel positioning to use setProperty with !important for consistent styling during drag operations 2025-03-28 14:38:55 +08:00
go0p e35113d82f Enhance proxy panel UI with improved styling and reset of host page CSS to ensure consistent appearance 2025-03-28 14:20:08 +08:00
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
go0p f463076def fix version 2025-03-04 16:14:13 +08:00
go0p 43743d729f Enhance webpack build script with production mode and progress tracking 2025-03-04 16:07:15 +08:00
go0p 8801de3441 update build script to use webpack directly 2025-03-04 16:07:15 +08:00
go0p 9a63f596b8 fix chrome doesn't give a damn about proxy on localhost 2025-03-04 16:07:15 +08:00
go0p 2253bdffb1 fix setting pac 2025-03-04 16:07:15 +08:00
go0p 322cd6dcd6 todo switch 2025-03-04 16:07:15 +08:00
go0p f0fb3f6cf0 fix popup options.html context 2025-03-04 16:07:15 +08:00
go0p 5066e9d89a add inject content ui 2025-03-04 16:07:15 +08:00
go0p 35184f4b25 yakit mitm config 2025-03-04 16:07:14 +08:00
go0p 1eee8217ec ui v0.0.2-beta 2025-03-04 16:07:14 +08:00
go0p 1149cfeb4d ui v0.0.1-beta 2025-03-04 16:07:14 +08:00
go0p cf10abc3f8 ui v0.0.1-beta 2025-03-04 16:07:14 +08:00
go0p 86dd6cd40c fix ui 2025-03-04 16:07:14 +08:00
go0p 06c053228c fix 2025-03-04 16:07:14 +08:00
go0p 6f82842c92 use indexedDB manager proxySwitch 2025-03-04 16:07:14 +08:00
go0p 1e25561fae add proxy switch demo 2025-03-04 16:07:14 +08:00
go0p 8c30607514 add proxy switch demo 2025-03-04 16:07:14 +08:00
go0p 692ab7760e fix inject 2025-03-04 16:07:14 +08:00
go0p 08796f91c4 feat(wsc) brute encrypt demo 2025-03-04 16:07:14 +08:00
go0p 7c3eb80872 feat(wsc) fuzzer demo 2025-03-04 16:07:14 +08:00
go0p 905298cbca Enhance release workflow with OSS upload and version tracking 2025-03-04 16:05:14 +08:00
8 changed files with 1459 additions and 645 deletions
+32 -8
View File
@@ -3,9 +3,8 @@ name: Build and Release
on: workflow_dispatch
jobs:
build-and-release:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
@@ -22,17 +21,18 @@ jobs:
- name: Build project
run: yarn build
- name: Get version
id: version
run: |
VERSION=$(jq -r '.version' build/manifest.json)
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "build_time=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
- name: Zip build artifacts
run: |
cd build
zip -r ../extension.zip .
- name: Generate version number
id: version
run: |
echo "version=1.0.${{ github.run_number }}" >> $GITHUB_OUTPUT
echo "build_time=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: actions/create-release@v1
@@ -57,3 +57,27 @@ jobs:
asset_path: ./extension.zip
asset_name: yakit-chrome-extension-v${{ steps.version.outputs.version }}.zip
asset_content_type: application/zip
- name: Upload Extension To OSS
uses: tvrcgo/upload-to-oss@master
with:
key-id: ${{ secrets.OSS_KEY_ID }}
key-secret: ${{ secrets.OSS_KEY_SECRET }}
region: oss-accelerate
bucket: yaklang
assets: |
extension.zip:/chrome-extension/yakit-chrome-extension-v${{ steps.version.outputs.version }}.zip
- name: Update OSS latest version file
run: echo ${{ steps.version.outputs.version }} > ./extension-version.txt
- name: Upload Version File to OSS
uses: tvrcgo/upload-to-oss@master
with:
key-id: ${{ secrets.OSS_KEY_ID }}
key-secret: ${{ secrets.OSS_KEY_SECRET }}
region: oss-accelerate
bucket: yaklang
assets: |
./extension-version.txt:/chrome-extension/latest-version.txt
+12 -3
View File
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Yakit Chrome Endpoint",
"version": "1.0",
"version": "0.0.7",
"description": "A Endpoint for Yakit MITM or more",
"options_ui": {
"page": "proxy/options.html",
@@ -24,9 +24,18 @@
},
"content_scripts": [
{
"matches": ["http://mitm/"],
"matches": ["<all_urls>","http://mitm/"],
"run_at": "document_start",
"js": ["proxy/content.js"]
"js": [
"proxy/links_finder.js"
]
},
{
"matches": ["<all_urls>","http://mitm/"],
"run_at": "document_end",
"js": [
"proxy/content.js"
]
}
],
"permissions": [
+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();
+1178 -621
View File
File diff suppressed because it is too large Load Diff
+213
View File
@@ -0,0 +1,213 @@
// Links Finder Module
class LinksFinder {
constructor() {
this.links = [];
this.lastUpdate = null;
}
// 获取页面所有链接
getAllLinks() {
const links = [];
const seen = new Set();
// 获取所有 a 标签
document.querySelectorAll('a').forEach(a => {
const href = a.href;
if (href && !seen.has(href) && href.startsWith('http')) {
seen.add(href);
links.push({
type: 'anchor',
url: href,
text: a.textContent.trim() || href,
});
}
});
// 获取所有图片链接
document.querySelectorAll('img').forEach(img => {
const src = img.src;
if (src && !seen.has(src) && src.startsWith('http')) {
seen.add(src);
links.push({
type: 'image',
url: src,
alt: img.alt || 'Image',
});
}
});
// 获取所有脚本链接
document.querySelectorAll('script').forEach(script => {
const src = script.src;
if (src && !seen.has(src) && src.startsWith('http')) {
seen.add(src);
links.push({
type: 'script',
url: src,
});
}
});
// 获取所有样式表链接
document.querySelectorAll('link[rel="stylesheet"]').forEach(link => {
const href = link.href;
if (href && !seen.has(href) && href.startsWith('http')) {
seen.add(href);
links.push({
type: 'stylesheet',
url: href,
});
}
});
this.links = links;
this.lastUpdate = new Date();
return links;
}
// 按类型过滤链接
filterLinksByType(type) {
return this.links.filter(link => link.type === type);
}
// 获取链接统计信息
getLinkStats() {
const stats = {
total: this.links.length,
byType: {}
};
this.links.forEach(link => {
if (!stats.byType[link.type]) {
stats.byType[link.type] = 0;
}
stats.byType[link.type]++;
});
return stats;
}
// 构建链接面板的 HTML
buildLinksPanel() {
const links = this.getAllLinks();
const stats = this.getLinkStats();
let html = `
<div class="links-stats">
<div class="stats-item">
<span>🔗</span>
<span>总链接: ${stats.total}</span>
</div>
</div>
<div class="links-filters">
<button class="filter-btn active" data-type="all">
<span>🔍</span>
<span>全部 (${stats.total})</span>
</button>
${Object.entries(stats.byType).map(([type, count]) => `
<button class="filter-btn" data-type="${type}">
<span>${this._getTypeIcon(type)}</span>
<span>${this._getTypeName(type)} (${count})</span>
</button>
`).join('')}
</div>
<div class="links-list">
${links.map(link => this._buildLinkItem(link)).join('')}
</div>
`;
return html;
}
// 获取链接类型图标
_getTypeIcon(type) {
const icons = {
anchor: '🔗',
image: '🖼️',
script: '📜',
stylesheet: '🎨'
};
return icons[type] || '🔗';
}
// 获取链接类型名称
_getTypeName(type) {
const names = {
anchor: '链接',
image: '图片',
script: '脚本',
stylesheet: '样式'
};
return names[type] || type;
}
// 构建单个链接项的 HTML
_buildLinkItem(link) {
return `
<div class="link-item" data-type="${link.type}">
<div class="link-icon">${this._getTypeIcon(link.type)}</div>
<div class="link-content">
<div class="link-url" title="${link.url}">${link.url}</div>
${link.text ? `<div class="link-text" title="${link.text}">${link.text}</div>` : ''}
${link.alt ? `<div class="link-alt" title="${link.alt}">${link.alt}</div>` : ''}
</div>
<button class="copy-btn" data-url="${link.url}" title="复制链接">📋</button>
</div>
`;
}
// 绑定事件处理
bindEvents(container) {
// 过滤按钮点击事件
container.querySelectorAll('.filter-btn').forEach(btn => {
btn.addEventListener('click', (e) => {
e.stopPropagation();
const type = btn.dataset.type;
console.log('Filter clicked:', type);
// 更新按钮状态
container.querySelectorAll('.filter-btn').forEach(b => {
b.classList.remove('active');
});
btn.classList.add('active');
// 过滤链接显示
container.querySelectorAll('.link-item').forEach(item => {
if (type === 'all' || item.dataset.type === type) {
item.removeAttribute('data-hidden');
} else {
item.setAttribute('data-hidden', 'true');
}
});
});
});
// 复制按钮点击事件
container.querySelectorAll('.copy-btn').forEach(btn => {
btn.addEventListener('click', async (e) => {
e.stopPropagation();
const url = btn.dataset.url;
try {
await navigator.clipboard.writeText(url);
const originalText = btn.textContent;
btn.textContent = '✓';
btn.style.setProperty('color', '#52c41a', 'important');
setTimeout(() => {
btn.textContent = originalText;
btn.style.removeProperty('color');
}, 1000);
} catch (err) {
console.error('Failed to copy:', err);
btn.textContent = '❌';
setTimeout(() => {
btn.textContent = '📋';
}, 1000);
}
});
});
}
}
console.log("LinksFinder module loaded");
// 导出模块
window.LinksFinder = LinksFinder;
+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,