Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
337be3e62e | ||
|
|
de7b76b150 | ||
|
|
d37e74e53f | ||
|
|
a1e258a4b8 | ||
|
|
40103d8a05 | ||
|
|
bc0772f292 | ||
|
|
3094b7970f | ||
|
|
e52c4c3ec6 |
No files matched your search
@@ -1,62 +1,62 @@
|
||||
# Pull Request
|
||||
|
||||
## Description
|
||||
<!-- Provide a brief description of the changes in this PR -->
|
||||
## 描述
|
||||
<!-- 简要描述此 PR 中的更改 -->
|
||||
|
||||
## Type of Change
|
||||
<!-- Mark the relevant option with an "x" -->
|
||||
- [ ] Bug fix (non-breaking change which fixes an issue)
|
||||
- [ ] New feature (non-breaking change which adds functionality)
|
||||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
||||
- [ ] Documentation update
|
||||
- [ ] Code refactoring (no functional changes)
|
||||
- [ ] Performance improvement
|
||||
## 更改类型
|
||||
<!-- 用 "x" 标记相关选项 -->
|
||||
- [ ] Bug 修复(修复问题的非破坏性更改)
|
||||
- [ ] 新功能(添加功能的非破坏性更改)
|
||||
- [ ] 破坏性更改(会导致现有功能无法正常工作的修复或功能)
|
||||
- [ ] 文档更新
|
||||
- [ ] 代码重构(无功能更改)
|
||||
- [ ] 性能改进
|
||||
|
||||
## Related Issues
|
||||
<!-- Link any related issues using #issue_number -->
|
||||
Fixes #(issue_number)
|
||||
## 相关问题
|
||||
<!-- 使用 #issue_number 链接任何相关问题 -->
|
||||
修复 #(问题编号)
|
||||
|
||||
## Changes Made
|
||||
<!-- Describe the specific changes made in this PR -->
|
||||
## 所做更改
|
||||
<!-- 描述此 PR 中的具体更改 -->
|
||||
-
|
||||
-
|
||||
-
|
||||
|
||||
## Testing
|
||||
<!-- Describe how you tested these changes -->
|
||||
- [ ] Tested on GitHub
|
||||
- [ ] Tested on GitLab
|
||||
- [ ] Tested on Hugging Face
|
||||
- [ ] Tested extension popup/settings
|
||||
- [ ] Tested with multiple file types
|
||||
- [ ] Verified no console errors
|
||||
## 测试
|
||||
<!-- 描述你如何测试这些更改 -->
|
||||
- [ ] 在 GitHub 上测试
|
||||
- [ ] 在 GitLab 上测试
|
||||
- [ ] 在 Hugging Face 上测试
|
||||
- [ ] 测试扩展弹出窗口/设置
|
||||
- [ ] 测试多种文件类型
|
||||
- [ ] 验证无控制台错误
|
||||
|
||||
## Platform Compatibility
|
||||
<!-- Check all platforms where you've tested the changes -->
|
||||
## 平台兼容性
|
||||
<!-- 检查你测试更改的所有平台 -->
|
||||
- [ ] GitHub
|
||||
- [ ] GitLab
|
||||
- [ ] Hugging Face
|
||||
|
||||
## Browser Testing
|
||||
<!-- Check browsers where you've tested -->
|
||||
## 浏览器测试
|
||||
<!-- 检查你测试过的浏览器 -->
|
||||
- [ ] Chrome
|
||||
- [ ] Microsoft Edge
|
||||
- [ ] Brave
|
||||
- [ ] Other: ____________
|
||||
- [ ] 其他:____________
|
||||
|
||||
## Screenshots/Videos
|
||||
<!-- Add screenshots or videos if applicable -->
|
||||
## 截图/视频
|
||||
<!-- 如果适用,添加截图或视频 -->
|
||||
|
||||
## Checklist
|
||||
## 检查清单
|
||||
|
||||
- [ ] I have read and followed the project guidelines
|
||||
- [ ] My code follows the existing code style
|
||||
- [ ] I have performed a self-review of my code
|
||||
- [ ] I have commented my code, particularly in hard-to-understand areas
|
||||
- [ ] My changes generate no new console errors or warnings
|
||||
- [ ] I have tested that existing functionality still works
|
||||
- [ ] Any new features include appropriate error handling
|
||||
- [ ] The extension manifest version has been updated if needed
|
||||
- [ ] 我已阅读并遵循项目指南
|
||||
- [ ] 我的代码遵循现有代码风格
|
||||
- [ ] 我已对我的代码进行自我审查
|
||||
- [ ] 我已对我的代码进行注释,特别是在难以理解的地方
|
||||
- [ ] 我的更改不会产生新的控制台错误或警告
|
||||
- [ ] 我已测试现有功能仍然正常工作
|
||||
- [ ] 任何新功能都包含适当的错误处理
|
||||
- [ ] 如果需要,扩展清单版本已更新
|
||||
|
||||
## Additional Notes
|
||||
<!-- Add any additional notes or context for reviewers -->
|
||||
## 附加说明
|
||||
<!-- 为审查者添加任何附加说明或上下文 -->
|
||||
@@ -1,10 +1,10 @@
|
||||
name: Publish Extension to Multiple Stores
|
||||
name: 发布扩展到多个应用商店
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "Version number (e.g., 1.0.0)"
|
||||
description: "版本号 (例如: 1.0.0)"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
@@ -17,79 +17,79 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
- name: 检出代码
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
- name: 设置 Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "18"
|
||||
|
||||
- name: Validate manifest.json
|
||||
- name: 验证 manifest.json
|
||||
run: |
|
||||
# Validate that manifest.json is valid JSON
|
||||
# 验证 manifest.json 是否为有效的 JSON
|
||||
node -e "JSON.parse(require('fs').readFileSync('manifest.json', 'utf8'))"
|
||||
echo "✅ manifest.json is valid"
|
||||
echo "✅ manifest.json 格式有效"
|
||||
|
||||
- name: Set version from input
|
||||
- name: 从输入设置版本
|
||||
id: version
|
||||
run: |
|
||||
# Use the manually provided version
|
||||
# 使用手动提供的版本
|
||||
VERSION="${{ inputs.version }}"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "Manually set version: $VERSION"
|
||||
echo "手动设置版本: $VERSION"
|
||||
|
||||
- name: Update manifest version
|
||||
- name: 更新 manifest 版本
|
||||
run: |
|
||||
# Update version in manifest.json to match the tag
|
||||
# 更新 manifest.json 中的版本以匹配标签
|
||||
node -e "
|
||||
const fs = require('fs');
|
||||
const manifest = JSON.parse(fs.readFileSync('manifest.json', 'utf8'));
|
||||
manifest.version = '${{ steps.version.outputs.version }}';
|
||||
fs.writeFileSync('manifest.json', JSON.stringify(manifest, null, 2));
|
||||
console.log('Updated manifest.json version to:', manifest.version);
|
||||
console.log('已更新 manifest.json 版本为:', manifest.version);
|
||||
"
|
||||
|
||||
- name: Update package.json version
|
||||
- name: 更新 package.json 版本
|
||||
run: |
|
||||
# Update version in package.json to match the tag
|
||||
# 更新 package.json 中的版本以匹配标签
|
||||
node -e "
|
||||
const fs = require('fs');
|
||||
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
||||
pkg.version = '${{ steps.version.outputs.version }}';
|
||||
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2));
|
||||
console.log('Updated package.json version to:', pkg.version);
|
||||
console.log('已更新 package.json 版本为:', pkg.version);
|
||||
"
|
||||
|
||||
- name: Commit and push version updates
|
||||
- name: 提交并推送版本更新
|
||||
run: |
|
||||
# Configure git user for the commit
|
||||
# 配置 git 用户信息以进行提交
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
|
||||
# Add the updated files
|
||||
# 添加更新的文件
|
||||
git add manifest.json package.json
|
||||
|
||||
# Check if there are changes to commit
|
||||
# 检查是否有需要提交的更改
|
||||
if git diff --staged --quiet; then
|
||||
echo "No version changes to commit"
|
||||
echo "没有版本更改需要提交"
|
||||
else
|
||||
# Commit the version updates
|
||||
git commit -m "chore: update version to ${{ steps.version.outputs.version }} [skip ci]"
|
||||
# 提交版本更新
|
||||
git commit -m "chore: 更新版本到 ${{ steps.version.outputs.version }} [skip ci]"
|
||||
|
||||
# Create and push a new tag for this version
|
||||
# 为此版本创建并推送新标签
|
||||
git tag "v${{ steps.version.outputs.version }}"
|
||||
|
||||
# Push to the main branch with the tag
|
||||
# 推送到主分支并包含标签
|
||||
git push origin HEAD:main
|
||||
git push origin "v${{ steps.version.outputs.version }}"
|
||||
|
||||
echo "✅ Version updates committed and pushed to main branch with tag"
|
||||
echo "✅ 版本更新已提交并推送到主分支,包含标签"
|
||||
fi
|
||||
|
||||
- name: Create extension packages
|
||||
- name: 创建扩展包
|
||||
run: |
|
||||
# Create Chrome extension zip
|
||||
# 创建 Chrome 扩展 zip 包
|
||||
zip -r chrome-extension.zip . \
|
||||
-x "*.git*" \
|
||||
-x "node_modules/*" \
|
||||
@@ -99,30 +99,30 @@ jobs:
|
||||
-x "*.zip" \
|
||||
-x "*.crx"
|
||||
|
||||
# Create Microsoft Edge extension zip (same as Chrome for MV3)
|
||||
# 创建 Microsoft Edge 扩展 zip 包(与 Chrome 的 MV3 相同)
|
||||
cp chrome-extension.zip edge-extension.zip
|
||||
|
||||
echo "📦 Created extension packages"
|
||||
echo "📦 已创建扩展包"
|
||||
ls -la *.zip
|
||||
|
||||
- name: Create CRX file for GitHub release
|
||||
- name: 为 GitHub 发布创建 CRX 文件
|
||||
run: |
|
||||
# Install chrome-extension-packer
|
||||
# 安装 chrome-extension-packer
|
||||
npm install -g crx3
|
||||
|
||||
# Create private key for CRX signing (for distribution only)
|
||||
# 为 CRX 签名创建私钥(仅用于分发)
|
||||
openssl genrsa -out key.pem 2048
|
||||
|
||||
# Verify manifest.json exists
|
||||
# 验证 manifest.json 是否存在
|
||||
ls -la manifest.json
|
||||
echo "Current directory: $(pwd)"
|
||||
echo "Contents:"
|
||||
echo "当前目录: $(pwd)"
|
||||
echo "目录内容:"
|
||||
ls -la
|
||||
|
||||
# Create temporary directory for extension files
|
||||
# 为扩展文件创建临时目录
|
||||
mkdir -p extension-temp
|
||||
|
||||
# Copy extension files to temp directory
|
||||
# 将扩展文件复制到临时目录
|
||||
cp manifest.json extension-temp/
|
||||
cp background.js extension-temp/
|
||||
cp content.js extension-temp/
|
||||
@@ -130,22 +130,22 @@ jobs:
|
||||
cp popup.js extension-temp/
|
||||
cp -r icons extension-temp/
|
||||
|
||||
# Verify temp directory contents
|
||||
echo "Extension temp directory contents:"
|
||||
# 验证临时目录内容
|
||||
echo "扩展临时目录内容:"
|
||||
ls -la extension-temp/
|
||||
|
||||
# Create CRX file from temp directory
|
||||
# 从临时目录创建 CRX 文件
|
||||
cd extension-temp
|
||||
crx3 -o ../extension.crx -p ../key.pem .
|
||||
cd ..
|
||||
|
||||
echo "📦 Created extension.crx"
|
||||
echo "📦 已创建 extension.crx"
|
||||
ls -la extension.crx
|
||||
|
||||
# Clean up
|
||||
# 清理
|
||||
rm -rf extension-temp
|
||||
|
||||
- name: Publish to Chrome Web Store
|
||||
- name: 发布到 Chrome 网上应用店
|
||||
continue-on-error: true
|
||||
id: chrome-publish
|
||||
uses: mnao305/chrome-extension-upload@v5.0.0
|
||||
@@ -155,9 +155,9 @@ jobs:
|
||||
client-id: ${{ secrets.CHROME_CLIENT_ID }}
|
||||
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
|
||||
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
|
||||
publish: true # Set to false if you want to upload without publishing
|
||||
publish: true # 如果只想上传而不发布,设置为 false
|
||||
|
||||
- name: Publish to Microsoft Edge Add-ons
|
||||
- name: 发布到 Microsoft Edge 加载项
|
||||
continue-on-error: true
|
||||
id: edge-publish
|
||||
uses: wdzeng/edge-addon@v2
|
||||
@@ -166,65 +166,62 @@ jobs:
|
||||
zip-path: edge-extension.zip
|
||||
api-key: ${{ secrets.EDGE_API_KEY }}
|
||||
client-id: ${{ secrets.EDGE_CLIENT_ID }}
|
||||
notes-for-certification: "Automatic release v${{ steps.version.outputs.version }} - ${{ github.sha }}"
|
||||
notes-for-certification: "自动发布 v${{ steps.version.outputs.version }} - ${{ github.sha }}"
|
||||
|
||||
- name: Create GitHub Release
|
||||
- name: 创建 GitHub 发布
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: v${{ steps.version.outputs.version }}
|
||||
name: Xget for Chrome ${{ steps.version.outputs.version }}
|
||||
files: |
|
||||
chrome-extension.zip
|
||||
edge-extension.zip
|
||||
extension.crx
|
||||
generate_release_notes: true
|
||||
body: |
|
||||
## Xget for Chrome v${{ steps.version.outputs.version }}
|
||||
此版本已自动发布到多个扩展商店。
|
||||
|
||||
This release has been automatically published to multiple extension stores.
|
||||
## 📦 安装选项
|
||||
|
||||
### 📦 Installation Options
|
||||
- **Chrome 网上应用店**: [从 Chrome 网上应用店安装](https://chromewebstore.google.com/detail/ajiejgobfcifcikbahpijopolfjoodgf)
|
||||
- **Microsoft Edge 加载项**: [从 Microsoft Edge 加载项安装](https://microsoftedge.microsoft.com/addons/detail/jigpfhbegabdenhihpplcjhpfdcgnalc)
|
||||
- **手动安装**: 下载下面的文件或查看 [安装指南](https://github.com/xixu-me/Xget-for-Chrome?tab=readme-ov-file#-installation) 获取详细说明
|
||||
|
||||
- **Chrome Web Store**: [Install from Chrome Web Store](https://chromewebstore.google.com/detail/ajiejgobfcifcikbahpijopolfjoodgf)
|
||||
- **Microsoft Edge Add-ons**: [Install from Microsoft Edge Add-ons](https://microsoftedge.microsoft.com/addons/detail/hbfflpongojnfojbgadppjgnkabkpjea)
|
||||
- **Manual Installation**: Download the files below or see the [Installation Guide](https://github.com/xixu-me/Xget-for-Chrome?tab=readme-ov-file#-installation) for detailed instructions
|
||||
## 📁 可用文件
|
||||
|
||||
### 📁 Available Files
|
||||
|
||||
- `chrome-extension.zip` - For Chrome browsers
|
||||
- `edge-extension.zip` - For Microsoft Edge
|
||||
- `extension.crx` - Pre-packaged extension file for all Chromium-based browsers
|
||||
|
||||
### Changes
|
||||
- See commit history for detailed changes
|
||||
- `chrome-extension.zip` - 适用于 Chrome 浏览器
|
||||
- `edge-extension.zip` - 适用于 Microsoft Edge
|
||||
- `extension.crx` - 适用于所有基于 Chromium 的浏览器的预打包扩展文件
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Check publication results
|
||||
- name: 检查发布结果
|
||||
run: |
|
||||
echo "📊 Publication Results Summary:"
|
||||
echo "📊 发布结果摘要:"
|
||||
echo "================================"
|
||||
|
||||
if [ "${{ steps.chrome-publish.outcome }}" = "success" ]; then
|
||||
echo "✅ Chrome Web Store: Successfully published"
|
||||
echo "✅ Chrome 网上应用店: 发布成功"
|
||||
elif [ "${{ steps.chrome-publish.outcome }}" = "failure" ]; then
|
||||
echo "❌ Chrome Web Store: Publication failed"
|
||||
echo "❌ Chrome 网上应用店: 发布失败"
|
||||
else
|
||||
echo "⚠️ Chrome Web Store: Skipped (missing secrets)"
|
||||
echo "⚠️ Chrome 网上应用店: 已跳过(缺少密钥)"
|
||||
fi
|
||||
|
||||
if [ "${{ steps.edge-publish.outcome }}" = "success" ]; then
|
||||
echo "✅ Microsoft Edge Add-ons: Successfully published"
|
||||
echo "✅ Microsoft Edge 加载项: 发布成功"
|
||||
elif [ "${{ steps.edge-publish.outcome }}" = "failure" ]; then
|
||||
echo "❌ Microsoft Edge Add-ons: Publication failed"
|
||||
echo "❌ Microsoft Edge 加载项: 发布失败"
|
||||
else
|
||||
echo "⚠️ Microsoft Edge Add-ons: Skipped (missing secrets)"
|
||||
echo "⚠️ Microsoft Edge 加载项: 已跳过(缺少密钥)"
|
||||
fi
|
||||
|
||||
echo "✅ GitHub Release: Created with extension files"
|
||||
echo "✅ GitHub 发布: 已创建扩展文件"
|
||||
echo "================================"
|
||||
|
||||
- name: Notify success
|
||||
- name: 通知成功
|
||||
run: |
|
||||
echo "🎉 Successfully published Xget for Chrome v${{ steps.version.outputs.version }} to multiple stores!"
|
||||
echo "🔗 Chrome Web Store: https://chrome.google.com/webstore/detail/${{ secrets.CHROME_EXTENSION_ID }}"
|
||||
echo "🔗 Microsoft Edge Add-ons: Check the releases page for manual installation files"
|
||||
echo "📦 GitHub Release: https://github.com/${{ github.repository }}/releases/tag/v${{ steps.version.outputs.version }}"
|
||||
echo "🎉 成功发布 Xget for Chrome v${{ steps.version.outputs.version }} 到多个商店!"
|
||||
echo "🔗 Chrome 网上应用店: https://chrome.google.com/webstore/detail/${{ secrets.CHROME_EXTENSION_ID }}"
|
||||
echo "🔗 Microsoft Edge 加载项: 查看发布页面获取手动安装文件"
|
||||
echo "📦 GitHub 发布: https://github.com/${{ github.repository }}/releases/tag/v${{ steps.version.outputs.version }}"
|
||||
+140
-126
@@ -1,202 +1,216 @@
|
||||
# Privacy Policy for Xget for Chrome
|
||||
# 隐私政策
|
||||
|
||||
## Last updated: July 9, 2025
|
||||
## 生效日期:2025 年 7 月 12 日
|
||||
|
||||
## Overview
|
||||
## 概述
|
||||
|
||||
Xget for Chrome is a browser extension that accelerates downloads by redirecting them through Xget proxy servers. This privacy policy explains how we collect, use, and protect your information when you use our extension.
|
||||
Xget for Chrome 是一个开源浏览器扩展,旨在通过 Xget 代理服务重定向下载链接来加速 GitHub、GitLab 和 Hugging Face 的下载。我们承诺保护您的隐私并确保数据处理的透明度。
|
||||
|
||||
## Information We Collect
|
||||
## 我们的隐私承诺
|
||||
|
||||
### 1. User Settings and Configuration Data
|
||||
**我们不收集、存储或传输您的个人数据。**
|
||||
|
||||
We collect and store the following information locally on your device:
|
||||
Xget for Chrome 扩展遵循“隐私优先”的设计原则,所有处理都在您的浏览器本地进行。
|
||||
|
||||
- **Xget Domain Configuration**: The domain you configure for the Xget service (e.g., "xget.xi-xu.me")
|
||||
- **Extension Enable/Disable Status**: Whether the extension is currently enabled
|
||||
- **Platform Preferences**: Your preferences for which platforms (GitHub, GitLab, Hugging Face) to use with the extension
|
||||
## 收集的信息
|
||||
|
||||
### 2. Download Activity Data
|
||||
### 我们收集的信息
|
||||
|
||||
The extension processes the following data during operation:
|
||||
**无**。该扩展不会收集、记录或传输任何个人身份信息、浏览历史记录或用户数据到外部服务器。
|
||||
|
||||
- **Download URLs**: URLs of files you attempt to download from supported platforms
|
||||
- **Referrer Information**: The webpage from which downloads are initiated
|
||||
- **File Information**: Basic file metadata like filenames when available
|
||||
### 我们不收集的信息
|
||||
|
||||
### 3. Browser Interaction Data
|
||||
- 个人身份信息(姓名、电子邮件、地址等)
|
||||
- 浏览历史记录或访问的网站
|
||||
- 下载的文件或下载历史
|
||||
- IP 地址或位置信息
|
||||
- 设备信息或浏览器指纹
|
||||
- 任何形式的分析或使用统计
|
||||
|
||||
- **Tab Information**: Limited tab data to send notifications about redirected downloads
|
||||
- **Click Events**: Detection of clicks on download links to trigger redirection
|
||||
## 本地数据存储
|
||||
|
||||
## How We Use Your Information
|
||||
### 扩展设置
|
||||
|
||||
### Local Processing Only
|
||||
该扩展仅在您的浏览器本地存储以下设置:
|
||||
|
||||
- All settings and preferences are stored locally in your browser using Chrome's storage API
|
||||
- Download URL transformation happens locally within the extension
|
||||
- No personal data is transmitted to our servers
|
||||
- **Xget 域名配置**:您设置的自定义 Xget 服务域名
|
||||
- **扩展启用状态**:扩展是否启用的开关状态
|
||||
- **平台偏好设置**:为 GitHub、GitLab 和 Hugging Face 启用/禁用的选择
|
||||
|
||||
### Download Redirection
|
||||
这些设置:
|
||||
|
||||
- We modify download URLs to redirect through your configured Xget domain
|
||||
- The original download URLs are processed locally to create Xget-compatible URLs
|
||||
- Redirected downloads are handled by the Xget service according to their privacy policy
|
||||
- 仅存储在您的浏览器中(使用 Chrome 的 `chrome.storage.sync` API)
|
||||
- 不会发送到我们的服务器或任何第三方
|
||||
- 可以随时通过扩展设置进行修改或删除
|
||||
- 在卸载扩展时会被完全清除
|
||||
|
||||
### Notifications
|
||||
### 数据同步
|
||||
|
||||
- We display local notifications to inform you when downloads are redirected
|
||||
- These notifications appear only in your browser and are not logged or transmitted
|
||||
如果您已登录 Chrome 并启用了扩展同步,您的扩展设置可能会在您的设备之间同步。这是由 Google 的 Chrome 同步服务处理的,不涉及我们的服务器。
|
||||
|
||||
## Data Storage and Security
|
||||
## 数据处理
|
||||
|
||||
### Local Storage
|
||||
### URL 转换处理
|
||||
|
||||
- All extension settings are stored using Chrome's synchronized storage API
|
||||
- Settings may sync across your Chrome browsers if you're signed into Chrome
|
||||
- No sensitive personal information is stored
|
||||
当您点击支持平台上的下载链接时,扩展会:
|
||||
|
||||
### Data Retention
|
||||
1. **在本地检测**下载链接
|
||||
2. **在您的浏览器中转换** URL 格式以与 Xget 兼容
|
||||
3. **重定向**您到转换后的 Xget URL
|
||||
|
||||
- Settings persist until you uninstall the extension or manually clear them
|
||||
- Download URLs are not stored; they are processed in real-time only
|
||||
- No browsing history or personal files are retained
|
||||
**重要**:此 URL 转换完全在您的浏览器中进行。原始 URL 和转换后的 URL 都不会发送给我们。
|
||||
|
||||
### Security Measures
|
||||
### 与 Xget 服务的交互
|
||||
|
||||
- All data processing occurs locally within your browser
|
||||
- No external communication except for redirected downloads through your configured Xget domain
|
||||
- Extension follows Chrome's security model and permissions system
|
||||
当您使用扩展时:
|
||||
|
||||
## Third-Party Services
|
||||
- 您的下载请求直接发送到您配置的 Xget 服务(如 `xget.xi-xu.me`)
|
||||
- 我们不充当中介或收集有关这些请求的任何信息
|
||||
- Xget 服务有自己的隐私政策,管理其数据处理实践
|
||||
|
||||
### Xget Service
|
||||
## 第三方服务
|
||||
|
||||
- When you download files, they are redirected through the Xget service you configure
|
||||
- The Xget service may have its own privacy policy governing how they handle downloads
|
||||
- We recommend reviewing the privacy policy of your chosen Xget service provider
|
||||
### Xget 代理服务
|
||||
|
||||
### Supported Platforms
|
||||
该扩展将下载重定向到 Xget 代理服务。请注意:
|
||||
|
||||
The extension operates on these platforms:
|
||||
- **默认服务**:`xget.xi-xu.me`(如果使用)
|
||||
- **自定义服务**:您可以配置任何兼容的 Xget 实例
|
||||
- **数据处理**:您的下载请求由 Xget 服务处理,不由此扩展处理
|
||||
|
||||
- **GitHub** (github.com)
|
||||
- **GitLab** (gitlab.com)
|
||||
- **Hugging Face** (huggingface.co)
|
||||
**重要**:请查看您使用的 Xget 服务的隐私政策,因为您的下载请求将由该服务处理。
|
||||
|
||||
We do not collect or store any account information from these platforms.
|
||||
### 受支持的平台
|
||||
|
||||
## Permissions Explained
|
||||
该扩展在以下平台上运行:
|
||||
|
||||
### Why We Need These Permissions
|
||||
- GitHub (github.com)
|
||||
- GitLab (gitlab.com)
|
||||
- Hugging Face (huggingface.co)
|
||||
|
||||
**Downloads Permission**:
|
||||
扩展不会与这些平台共享任何数据,也不会修改您与这些平台的交互,除了重定向下载链接。
|
||||
|
||||
- Required to intercept and redirect download requests
|
||||
- Allows the extension to cancel original downloads and start redirected ones
|
||||
## 权限说明
|
||||
|
||||
**Storage Permission**:
|
||||
### 请求的权限
|
||||
|
||||
- Used to save your extension settings and preferences locally
|
||||
- Enables settings synchronization across your Chrome browsers
|
||||
该扩展请求以下浏览器权限:
|
||||
|
||||
**Active Tab Permission**:
|
||||
1. **`downloads`**:检测和管理下载以进行重定向
|
||||
2. **`storage`**:在本地存储您的扩展设置
|
||||
3. **`activeTab`**:在当前标签页中显示通知
|
||||
4. **`host_permissions`**:访问受支持平台以检测下载链接
|
||||
|
||||
- Needed to send notifications about redirected downloads
|
||||
- Does not allow reading page content or personal information
|
||||
### 权限使用
|
||||
|
||||
**Host Permissions** (github.com, gitlab.com, huggingface.co):
|
||||
- **下载权限**:仅用于检测下载并将其重定向到 Xget
|
||||
- **存储权限**:仅用于保存您的扩展设置
|
||||
- **标签页权限**:仅用于显示下载重定向通知
|
||||
- **主机权限**:仅用于在受支持平台上检测下载链接
|
||||
|
||||
- Required to run the extension on supported platforms
|
||||
- Allows detection and redirection of download links
|
||||
我们不使用这些权限来收集数据、跟踪您的活动或任何其他目的。
|
||||
|
||||
**Web Request Permissions**:
|
||||
## 数据安全
|
||||
|
||||
- Used for download interception functionality
|
||||
- Does not monitor general browsing activity
|
||||
### 本地处理
|
||||
|
||||
## Your Privacy Rights
|
||||
- 所有扩展逻辑在您的浏览器中本地运行
|
||||
- 不建立到我们服务器的网络连接
|
||||
- 没有数据传输到外部分析服务
|
||||
|
||||
### Control Over Your Data
|
||||
### 开源透明性
|
||||
|
||||
- You can disable the extension at any time through the popup interface
|
||||
- You can configure which platforms to use with the extension
|
||||
- You can change or remove your Xget domain configuration
|
||||
- Uninstalling the extension removes all stored settings
|
||||
- 扩展是完全开源的
|
||||
- 源代码可在 [GitHub](https://github.com/xixu-me/Xget-for-Chrome) 上获得
|
||||
- 您可以审查、验证和审计所有代码
|
||||
|
||||
### Data Portability
|
||||
## 您的权利
|
||||
|
||||
- Settings are stored in standard Chrome storage format
|
||||
- You can export/backup Chrome extension settings through Chrome's sync feature
|
||||
### 数据控制
|
||||
|
||||
### Data Deletion
|
||||
您可以完全控制扩展存储的有限数据:
|
||||
|
||||
- Clear extension data by uninstalling the extension
|
||||
- Reset settings through the extension popup interface
|
||||
- Clear Chrome's extension storage to remove all traces
|
||||
- **查看**:通过扩展弹出窗口查看您的设置
|
||||
- **修改**:随时更改您的设置
|
||||
- **删除**:卸载扩展以删除所有存储的数据
|
||||
|
||||
## Children's Privacy
|
||||
### 选择退出
|
||||
|
||||
This extension is not intended for use by children under 13 years of age. We do not knowingly collect personal information from children under 13.
|
||||
您可以随时:
|
||||
|
||||
## Changes to This Privacy Policy
|
||||
- 在扩展设置中禁用扩展
|
||||
- 为特定平台禁用重定向
|
||||
- 完全卸载扩展
|
||||
|
||||
We may update this privacy policy from time to time. When we do, we will:
|
||||
## 儿童隐私
|
||||
|
||||
- Update the "Last updated" date at the top of this policy
|
||||
- Notify users through the extension interface if there are material changes
|
||||
- Maintain previous versions for reference
|
||||
该扩展不会有意收集 13 岁以下儿童的信息。实际上,该扩展不会收集任何用户的任何个人信息。
|
||||
|
||||
## Compliance
|
||||
## 国际数据传输
|
||||
|
||||
This extension is designed to comply with:
|
||||
由于扩展不收集或传输任何个人数据,因此不涉及国际数据传输。您配置的任何 Xget 服务都将根据其自己的隐私政策处理数据传输。
|
||||
|
||||
- Chrome Web Store Developer Policies
|
||||
- General Data Protection Regulation (GDPR)
|
||||
- California Consumer Privacy Act (CCPA)
|
||||
- Other applicable privacy laws
|
||||
## 政策更新
|
||||
|
||||
## Technical Implementation
|
||||
### 更改通知
|
||||
|
||||
### Data Minimization
|
||||
我们可能会不时更新此隐私政策。任何更改将:
|
||||
|
||||
- We collect only the minimum data necessary for functionality
|
||||
- No analytics, tracking, or telemetry data is collected
|
||||
- No user identification or profiling occurs
|
||||
- 在此页面上发布
|
||||
- 在更新的策略顶部包含新的生效日期
|
||||
- 如果是重大更改,将通过扩展更新或其他方式通知
|
||||
|
||||
### Transparency
|
||||
### 持续使用
|
||||
|
||||
- All source code is available for review
|
||||
- Extension behavior is predictable and documented
|
||||
- No hidden data collection or processing
|
||||
在任何更改后继续使用扩展即表示您接受更新的隐私政策。
|
||||
|
||||
## Contact Information
|
||||
## 联系我们
|
||||
|
||||
If you have any questions about this privacy policy or the extension's data practices:
|
||||
如果您对此隐私政策有任何问题、疑虑或建议,请:
|
||||
|
||||
- **Developer**: Xi Xu
|
||||
- **Repository**: [Xget for Chrome on GitHub](https://github.com/xixu-me/Xget-for-Chrome)
|
||||
- **Issues**: [Report Issues](https://github.com/xixu-me/Xget-for-Chrome/issues)
|
||||
- **GitHub Issues**:在我们的 [GitHub 存储库](https://github.com/xixu-me/Xget-for-Chrome/issues) 上打开一个 issue
|
||||
- **电子邮件**:通过我们的 GitHub 配置文件联系维护者
|
||||
|
||||
## Open Source Commitment
|
||||
## 法律合规
|
||||
|
||||
This extension is open source software licensed under GPL-3.0. You can:
|
||||
### 数据保护法律
|
||||
|
||||
- Review the complete source code
|
||||
- Verify our privacy practices
|
||||
- Submit issues or improvements
|
||||
- Fork and modify the code
|
||||
由于该扩展不收集个人数据,因此它符合主要的数据保护法规,包括:
|
||||
|
||||
## Data Protection Summary
|
||||
- **GDPR**(欧盟一般数据保护条例)
|
||||
- **CCPA**(加州消费者隐私法)
|
||||
- **其他地区数据保护法律**
|
||||
|
||||
| Data Type | Collection | Storage | Sharing | Retention |
|
||||
|-----------|------------|---------|---------|-----------|
|
||||
| Extension Settings | Local only | Browser storage | Chrome sync only | Until uninstall |
|
||||
| Download URLs | Processed locally | Not stored | Redirected only | Real-time only |
|
||||
| Personal Information | None | None | None | None |
|
||||
| Browsing History | None | None | None | None |
|
||||
| User Identity | None | None | None | None |
|
||||
### 最小数据实践
|
||||
|
||||
该扩展遵循数据最小化原则:
|
||||
|
||||
- 仅存储功能绝对必要的数据
|
||||
- 不收集可识别或敏感信息
|
||||
- 实施最小权限访问
|
||||
|
||||
## 技术实施
|
||||
|
||||
### 隐私设计
|
||||
|
||||
该扩展实施了以下隐私保护措施:
|
||||
|
||||
- **无网络通信**:除了重定向下载外,不进行任何网络调用
|
||||
- **本地处理**:所有逻辑在浏览器中执行
|
||||
- **无跟踪**:不包含分析、跟踪或遥测代码
|
||||
- **最小权限**:仅请求功能所需的权限
|
||||
|
||||
### 代码审计
|
||||
|
||||
作为开源项目:
|
||||
|
||||
- 所有代码都是可验证的
|
||||
- 社区可以审计隐私实践
|
||||
- 不包含隐藏或混淆的功能
|
||||
|
||||
---
|
||||
|
||||
By using Xget for Chrome, you acknowledge that you have read and understood this privacy policy and agree to the data practices described herein.
|
||||
**最后更新**:2025年7月12日
|
||||
**联系方式**:[GitHub Issues](https://github.com/xixu-me/Xget-for-Chrome/issues)
|
||||
|
||||
此隐私政策是我们对透明度和用户隐私承诺的一部分。我们相信您有权了解您使用的软件如何处理您的数据,以及在这种情况下,确认它不会处理您的个人数据。
|
||||
@@ -1,257 +1,257 @@
|
||||
# Xget for Chrome
|
||||
|
||||
A powerful Chrome extension that accelerates downloads from GitHub, GitLab, and Hugging Face by automatically redirecting them through the [Xget](https://github.com/xixu-me/Xget) proxy service.
|
||||
一个强大的 Chromium 浏览器扩展,通过自动将下载重定向到 [Xget](https://github.com/xixu-me/Xget) 代理服务,从而加速 GitHub、GitLab 和 Hugging Face 的下载。
|
||||
|
||||
## 🚀 Features
|
||||
## 🚀 功能特性
|
||||
|
||||
- **🎯 Automatic Download Acceleration**: Seamlessly redirects downloads through Xget for faster speeds
|
||||
- **🌐 Multi-Platform Support**: Works with GitHub, GitLab, and Hugging Face
|
||||
- **⚙️ Configurable Settings**: Customize your Xget domain and platform preferences
|
||||
- **🔔 Smart Notifications**: Visual feedback when downloads are redirected
|
||||
- **🛡️ Privacy-First**: All processing happens locally in your browser
|
||||
- **🎛️ Per-Platform Control**: Enable/disable acceleration for specific platforms
|
||||
- **🎯 自动下载加速**:无缝重定向下载通过 Xget 获得更快速度
|
||||
- **🌐 多平台支持**:支持 GitHub、GitLab 和 Hugging Face
|
||||
- **⚙️ 可配置设置**:自定义你的 Xget 域名和平台偏好
|
||||
- **🔔 智能通知**:下载重定向时的可视化反馈
|
||||
- **🛡️ 隐私优先**:所有处理都在你的浏览器本地进行
|
||||
- **🎛️ 按平台控制**:为特定平台启用/禁用加速
|
||||
|
||||
## 📦 Installation
|
||||
## 📦 安装
|
||||
|
||||
### Store Availability
|
||||
### 应用商店可用性
|
||||
|
||||
| Store | Link |
|
||||
| 商店 | 链接 |
|
||||
|-------|------|
|
||||
| **Chrome Web Store** | [](https://chromewebstore.google.com/detail/ajiejgobfcifcikbahpijopolfjoodgf) |
|
||||
| **Microsoft Edge Add-ons** | [Available in the Microsoft Edge Add-ons](https://microsoftedge.microsoft.com/addons/detail/hbfflpongojnfojbgadppjgnkabkpjea) |
|
||||
| **Chrome 网上应用店** | [](https://chromewebstore.google.com/detail/ajiejgobfcifcikbahpijopolfjoodgf) |
|
||||
| **Microsoft Edge 加载项** | [Available in the Microsoft Edge Add-ons](https://microsoftedge.microsoft.com/addons/detail/jigpfhbegabdenhihpplcjhpfdcgnalc) |
|
||||
|
||||
### Manual Installation
|
||||
### 手动安装
|
||||
|
||||
If you prefer to install the extension manually or the store versions are not available, you can download and install it directly:
|
||||
如果你更喜欢手动安装扩展或应用商店版本不可用,你可以直接下载并安装:
|
||||
|
||||
#### Option 1: Install from GitHub Releases (Recommended)
|
||||
#### 选项 1:从 GitHub Releases 安装(推荐)
|
||||
|
||||
1. **Download the Extension**
|
||||
- Go to the [Releases page](https://github.com/xixu-me/Xget-for-Chrome/releases)
|
||||
- Download the latest release file:
|
||||
- `chrome-extension.zip` - For Chrome browsers
|
||||
- `edge-extension.zip` - For Microsoft Edge
|
||||
- `extension.crx` - Pre-packaged extension file for all Chromium-based browsers
|
||||
1. **下载扩展**
|
||||
- 前往 [Releases 页面](https://github.com/xixu-me/Xget-for-Chrome/releases)
|
||||
- 下载最新发布文件:
|
||||
- `chrome-extension.zip` - 适用于 Chrome 浏览器
|
||||
- `edge-extension.zip` - 适用于 Microsoft Edge
|
||||
- `extension.crx` - 适用于所有基于 Chromium 的浏览器的预打包扩展文件
|
||||
|
||||
2. **Install in Chrome**
|
||||
- Open Chrome and go to `chrome://extensions/`
|
||||
- Enable "Developer mode" (toggle in top right)
|
||||
- Click "Load unpacked" and select the extracted folder from the ZIP file
|
||||
- Or drag and drop the `.crx` file directly onto the extensions page
|
||||
2. **在 Chrome 中安装**
|
||||
- 打开 Chrome 并前往 `chrome://extensions/`
|
||||
- 启用「开发者模式」(右上角的切换开关)
|
||||
- 点击「加载已解压的扩展程序」并选择从 ZIP 文件解压的文件夹
|
||||
- 或者直接将 `.crx` 文件拖放到扩展页面
|
||||
|
||||
3. **Install in Microsoft Edge**
|
||||
- Open Microsoft Edge and go to `edge://extensions/`
|
||||
- Enable "Developer mode" (toggle in left sidebar)
|
||||
- Click "Load unpacked" and select the extracted folder from the ZIP file
|
||||
- Or drag and drop the `.crx` file directly onto the extensions page
|
||||
3. **在 Microsoft Edge 中安装**
|
||||
- 打开 Microsoft Edge 并前往 `edge://extensions/`
|
||||
- 启用「开发人员模式」(左侧边栏的切换开关)
|
||||
- 点击「加载解压缩的扩展」并选择从 ZIP 文件解压的文件夹
|
||||
- 或者直接将 `.crx` 文件拖放到扩展页面
|
||||
|
||||
4. **Install in other Chromium-based browsers**
|
||||
- Follow similar steps as Chrome or Microsoft Edge, ensuring you enable "Developer mode" first
|
||||
- Drag and drop the `.crx` file directly onto the extensions page
|
||||
4. **在其他基于 Chromium 的浏览器中安装**
|
||||
- 遵循与 Chrome 或 Microsoft Edge 类似的步骤,确保首先启用「开发者模式」
|
||||
- 直接将 `.crx` 文件拖放到扩展页面
|
||||
|
||||
#### Option 2: Install from Source Code
|
||||
#### 选项 2:从源码安装
|
||||
|
||||
1. **Clone the Repository**
|
||||
1. **克隆存储库**
|
||||
|
||||
```bash
|
||||
git clone https://github.com/xixu-me/Xget-for-Chrome.git
|
||||
cd Xget-for-Chrome
|
||||
```
|
||||
|
||||
2. **Load in Browser**
|
||||
- Open your browser's extension management page
|
||||
- Enable "Developer mode"
|
||||
- Click "Load unpacked" and select the cloned folder
|
||||
2. **在浏览器中加载**
|
||||
- 打开浏览器的扩展管理页面
|
||||
- 启用「开发者模式」
|
||||
- 点击「加载已解压的扩展程序」并选择克隆的文件夹
|
||||
|
||||
#### Verify Installation
|
||||
#### 验证安装
|
||||
|
||||
After installation, you should see the Xget extension icon in your browser toolbar. Click it to configure your Xget domain and start accelerating downloads!
|
||||
安装后,你应该在浏览器工具栏中看到 Xget 扩展图标。点击它来配置你的 Xget 域名并开始加速下载!
|
||||
|
||||
## ⚙️ Setup
|
||||
## ⚙️ 设置
|
||||
|
||||
1. **Configure Xget Domain**
|
||||
- Click the extension icon in your toolbar
|
||||
- Enter your Xget domain (e.g., `xget.xi-xu.me`)
|
||||
- Enable the extension
|
||||
1. **配置 Xget 域名**
|
||||
- 点击工具栏中的扩展图标
|
||||
- 输入你的 Xget 域名(例如 `xget.xi-xu.me`)
|
||||
- 启用扩展
|
||||
|
||||
2. **Choose Platforms** (Optional)
|
||||
- Toggle individual platforms on/off as needed
|
||||
- All platforms (GitHub, GitLab, Hugging Face) are enabled by default
|
||||
2. **选择平台**(可选)
|
||||
- 根据需要切换各个平台的开关
|
||||
- 默认启用所有平台(GitHub、GitLab、Hugging Face)
|
||||
|
||||
3. **Start Downloading**
|
||||
- Visit any supported platform
|
||||
- Click download links as usual
|
||||
- Downloads will be automatically accelerated through Xget
|
||||
3. **开始下载**
|
||||
- 访问任何受支持的平台
|
||||
- 像往常一样点击下载链接
|
||||
- 下载将自动通过 Xget 加速
|
||||
|
||||
## 🎯 Supported Platforms
|
||||
## 🎯 支持的平台
|
||||
|
||||
| Platform | Status | URL Pattern | Extension ID |
|
||||
| 平台 | 状态 | URL 模式 | 扩展 ID |
|
||||
|----------|---------|-------------|--------------|
|
||||
| **GitHub** | ✅ Supported | `github.com/*` | `gh` |
|
||||
| **GitLab** | ✅ Supported | `gitlab.com/*` | `gl` |
|
||||
| **Hugging Face** | ✅ Supported | `huggingface.co/*` | `hf` |
|
||||
| **GitHub** | ✅ 支持 | `github.com/*` | `gh` |
|
||||
| **GitLab** | ✅ 支持 | `gitlab.com/*` | `gl` |
|
||||
| **Hugging Face** | ✅ 支持 | `huggingface.co/*` | `hf` |
|
||||
|
||||
### Supported Download Types
|
||||
### 支持的下载类型
|
||||
|
||||
- **GitHub**: Release assets, repository archives, raw files, Git LFS files
|
||||
- **GitLab**: Project archives, release downloads, repository exports
|
||||
- **Hugging Face**: Model files, dataset files, model cards, tokenizers
|
||||
- **GitHub**:发布资源、存储库存档、原始文件、Git LFS 文件
|
||||
- **GitLab**:项目存档、发布下载、存储库导出
|
||||
- **Hugging Face**:模型文件、数据集文件、模型卡片、分词器
|
||||
|
||||
## 🔧 How It Works
|
||||
## 🔧 工作原理
|
||||
|
||||
1. **Detection**: The extension monitors download links on supported platforms
|
||||
2. **Transformation**: URLs are automatically converted to Xget-compatible format
|
||||
3. **Redirection**: Downloads are routed through your configured Xget domain
|
||||
4. **Acceleration**: Xget's global CDN and optimization features deliver faster download speeds
|
||||
1. **检测**:扩展监控受支持平台上的下载链接
|
||||
2. **转换**:URL 自动转换为 Xget 兼容格式
|
||||
3. **重定向**:下载通过你配置的 Xget 域名路由
|
||||
4. **加速**:Xget 的全球 CDN 和优化功能提供更快的下载速度
|
||||
|
||||
### URL Transformation Examples
|
||||
### URL 转换示例
|
||||
|
||||
```text
|
||||
Original: https://github.com/user/repo/archive/main.zip
|
||||
Xget: https://xget.xi-xu.me/gh/user/repo/archive/main.zip
|
||||
原始: https://github.com/user/repo/archive/main.zip
|
||||
Xget: https://xget.xi-xu.me/gh/user/repo/archive/main.zip
|
||||
|
||||
Original: https://gitlab.com/user/repo/-/archive/main.zip
|
||||
Xget: https://xget.xi-xu.me/gl/user/repo/-/archive/main.zip
|
||||
原始: https://gitlab.com/user/repo/-/archive/main.zip
|
||||
Xget: https://xget.xi-xu.me/gl/user/repo/-/archive/main.zip
|
||||
|
||||
Original: https://huggingface.co/user/model/resolve/main/model.bin
|
||||
Xget: https://xget.xi-xu.me/hf/user/model/resolve/main/model.bin
|
||||
原始: https://huggingface.co/user/model/resolve/main/model.bin
|
||||
Xget: https://xget.xi-xu.me/hf/user/model/resolve/main/model.bin
|
||||
```
|
||||
|
||||
### Why Xget Makes Downloads Faster
|
||||
### 为什么 Xget 让下载更快
|
||||
|
||||
- **Edge Caching**: Files are cached at Cloudflare's global edge locations
|
||||
- **HTTP/3 Support**: Uses the latest protocol for improved performance
|
||||
- **Intelligent Routing**: Automatically routes through the fastest available server
|
||||
- **Compression**: Automatic content compression reduces transfer times
|
||||
- **Connection Optimization**: Persistent connections and preconnection features
|
||||
- **边缘缓存**:文件在 Cloudflare 的全球边缘位置进行缓存
|
||||
- **HTTP/3 支持**:使用最新协议提高性能
|
||||
- **智能路由**:自动通过最快的可用服务器路由
|
||||
- **压缩**:自动内容压缩减少传输时间
|
||||
- **连接优化**:持久连接和预连接功能
|
||||
|
||||
## 📈 Performance Benefits
|
||||
## 📈 性能优势
|
||||
|
||||
Real-world performance improvements with Xget:
|
||||
使用 Xget 的实际性能改进:
|
||||
|
||||
- **GitHub releases**: Up to 5x faster download speeds
|
||||
- **Large repositories**: Significant improvement for multi-GB archives
|
||||
- **International users**: Dramatically faster downloads through edge caching
|
||||
- **Unstable connections**: Automatic retry mechanisms handle network issues
|
||||
- **Concurrent downloads**: No rate limiting compared to direct platform downloads
|
||||
- **GitHub 发布**:下载速度提升高达 5 倍
|
||||
- **大型存储库**:多 GB 存档的显著改进
|
||||
- **国际用户**:通过边缘缓存显著加快下载速度
|
||||
- **不稳定连接**:自动重试机制处理网络问题
|
||||
- **并发下载**:与直接平台下载相比,没有速率限制
|
||||
|
||||
### Benchmarks
|
||||
### 基准测试
|
||||
|
||||
| File Type | Original Speed | With Xget | Improvement |
|
||||
| 文件类型 | 原始速度 | 使用 Xget | 提升 |
|
||||
|-----------|----------------|-----------|-------------|
|
||||
| GitHub Release (100MB) | 2.5 MB/s | 12.8 MB/s | **5.1x faster** |
|
||||
| Repository Archive (50MB) | 1.8 MB/s | 8.2 MB/s | **4.6x faster** |
|
||||
| Hugging Face Model (500MB) | 3.2 MB/s | 15.1 MB/s | **4.7x faster** |
|
||||
| GitHub Release (100MB) | 2.5 MB/s | 12.8 MB/s | **快 5.1 倍** |
|
||||
| 存储库存档 (50MB) | 1.8 MB/s | 8.2 MB/s | **快 4.6 倍** |
|
||||
| Hugging Face 模型 (500MB) | 3.2 MB/s | 15.1 MB/s | **快 4.7 倍** |
|
||||
|
||||
> **Note**: Results may vary based on location, network conditions, and server load
|
||||
> **注意**:结果可能因位置、网络条件和服务器负载而异
|
||||
|
||||
## 📋 Requirements
|
||||
## 📋 要求
|
||||
|
||||
- **Chrome Browser**: Version 88+ (Manifest V3 support)
|
||||
- **Xget Service**: Access to an Xget instance
|
||||
- Use the public instance: `xget.xi-xu.me`
|
||||
- Or deploy your own: [Xget Repository](https://github.com/xixu-me/Xget) (Recommended)
|
||||
- **Chrome 浏览器**:版本 88+(Manifest V3 支持)
|
||||
- **Xget 服务**:访问 Xget 实例
|
||||
- 使用公共实例:`xget.xi-xu.me`
|
||||
- 或部署你自己的:[Xget 存储库](https://github.com/xixu-me/Xget)(推荐)
|
||||
|
||||
### About Xget Service
|
||||
### 关于 Xget 服务
|
||||
|
||||
Xget is a high-performance, secure proxy service built on Cloudflare Workers that provides:
|
||||
Xget 是基于 Cloudflare Workers 构建的高性能、安全的代理服务,提供:
|
||||
|
||||
- **Global Edge Distribution**: Faster downloads through Cloudflare's global network
|
||||
- **Multi-Platform Support**: Optimized for GitHub, GitLab, and Hugging Face
|
||||
- **Advanced Features**: HTTP/3 support, intelligent caching, automatic retries
|
||||
- **Security**: Comprehensive security headers and content protection
|
||||
- **Reliability**: Built-in timeout protection and performance monitoring
|
||||
- **全球边缘分发**:通过 Cloudflare 的全球网络加快下载速度
|
||||
- **多平台支持**:针对 GitHub、GitLab 和 Hugging Face 进行优化
|
||||
- **高级功能**:HTTP/3 支持、智能缓存、自动重试
|
||||
- **安全性**:全面的安全标头和内容保护
|
||||
- **可靠性**:内置超时保护和性能监控
|
||||
|
||||
Learn more at [xget.xi-xu.me](https://xget.xi-xu.me) or the [Xget repository](https://github.com/xixu-me/Xget).
|
||||
在 [xget.xi-xu.me](https://xget.xi-xu.me) 或 [Xget 存储库](https://github.com/xixu-me/Xget) 了解更多。
|
||||
|
||||
## 🔒 Privacy & Security
|
||||
## 🔒 隐私与安全
|
||||
|
||||
- **Local Processing**: All URL transformations happen in your browser
|
||||
- **No Data Collection**: The extension doesn't collect or transmit personal data
|
||||
- **Minimal Permissions**: Only requests necessary permissions for functionality
|
||||
- **Open Source**: Full source code available for inspection
|
||||
- **本地处理**:所有 URL 转换都在你的浏览器中进行
|
||||
- **无数据收集**:扩展不收集或传输个人数据
|
||||
- **最小权限**:仅请求功能所需的必要权限
|
||||
- **开源**:完整源码可供检查
|
||||
|
||||
See our [Privacy Policy](PRIVACY_POLICY.md) for complete details.
|
||||
查看我们的 [隐私政策](PRIVACY_POLICY.md) 了解完整详情。
|
||||
|
||||
## 🐛 Troubleshooting
|
||||
## 🐛 故障排除
|
||||
|
||||
### Common Issues
|
||||
### 常见问题
|
||||
|
||||
**Extension not working?**
|
||||
**扩展不工作?**
|
||||
|
||||
- Ensure you've configured a valid Xget domain
|
||||
- Check that the extension is enabled in the popup
|
||||
- Verify the target platform is enabled
|
||||
- Try refreshing the page after changing settings
|
||||
- 确保你已配置有效的 Xget 域名
|
||||
- 检查扩展在弹出窗口中是否已启用
|
||||
- 验证目标平台是否已启用
|
||||
- 更改设置后尝试刷新页面
|
||||
|
||||
**Downloads not being redirected?**
|
||||
**下载没有被重定向?**
|
||||
|
||||
- Refresh the page after changing settings
|
||||
- Check browser console for error messages (F12 → Console)
|
||||
- Ensure the link is a recognized download type
|
||||
- Verify you're clicking actual download links, not navigation links
|
||||
- 更改设置后刷新页面
|
||||
- 检查浏览器控制台的错误消息(F12 → 控制台)
|
||||
- 确保链接是被识别的下载类型
|
||||
- 验证你点击的是实际的下载链接,而不是导航链接
|
||||
|
||||
**Xget domain issues?**
|
||||
**Xget 域名问题?**
|
||||
|
||||
- Domain should be without `https://` protocol
|
||||
- Example: `xget.xi-xu.me` (not `https://xget.xi-xu.me`)
|
||||
- Check that the domain is accessible in your browser
|
||||
- Try using the default public instance: `xget.xi-xu.me`
|
||||
- 域名应该不带 `https://` 协议
|
||||
- 示例:`xget.xi-xu.me`(不是 `https://xget.xi-xu.me`)
|
||||
- 检查域名在浏览器中是否可访问
|
||||
- 尝试使用默认的公共实例:`xget.xi-xu.me`
|
||||
|
||||
**Performance issues?**
|
||||
**性能问题?**
|
||||
|
||||
- Check your network connection
|
||||
- Try a different Xget domain if available
|
||||
- Verify the target platform's servers are responsive
|
||||
- Clear browser cache and reload the extension
|
||||
- 检查你的网络连接
|
||||
- 如果可用,尝试其他 Xget 域名
|
||||
- 验证目标平台的服务器是否响应
|
||||
- 清除浏览器缓存并重新加载扩展
|
||||
|
||||
### Debug Mode
|
||||
### 调试模式
|
||||
|
||||
Enable Chrome Developer Tools and check the Console tab for debug messages:
|
||||
启用 Chrome 开发者工具并检查控制台选项卡中的调试消息:
|
||||
|
||||
- Extension loading: "Xget for Chrome: Content script loaded"
|
||||
- Download redirection: "Redirecting download: [original] -> [xget]"
|
||||
- Settings changes: "Settings updated! Click to refresh page"
|
||||
- 扩展加载:「Xget for Chrome:内容脚本已加载」
|
||||
- 下载重定向:「重定向下载:[原始] -> [xget]」
|
||||
- 设置更改:「设置已更新!点击刷新页面」
|
||||
|
||||
## 📄 License
|
||||
## 📄 许可证
|
||||
|
||||
This project is licensed under the GPL-3.0 License - see the [LICENSE](LICENSE) file for details.
|
||||
本项目采用 GPL-3.0 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情。
|
||||
|
||||
## ❓ Frequently Asked Questions
|
||||
## ❓ 常见问题
|
||||
|
||||
### Is this extension free?
|
||||
### 这个扩展是免费的吗?
|
||||
|
||||
Yes, the extension is completely free and open source under the GPL-3.0 license.
|
||||
是的,扩展完全免费且在 GPL-3.0 许可证下开源。
|
||||
|
||||
### Does this work with private repositories?
|
||||
### 这对私有存储库有效吗?
|
||||
|
||||
The extension works with any downloadable link, but you need appropriate access permissions for private repositories.
|
||||
扩展适用于任何可下载链接,但你需要对私有存储库有适当的访问权限。
|
||||
|
||||
### Can I use my own Xget server?
|
||||
### 我可以使用自己的 Xget 服务器吗?
|
||||
|
||||
Absolutely! You can deploy your own Xget instance using the [Xget repository](https://github.com/xixu-me/Xget) and configure the extension to use your domain.
|
||||
当然可以!你可以使用 [Xget 存储库](https://github.com/xixu-me/Xget) 部署自己的 Xget 实例,并配置扩展使用你的域名。
|
||||
|
||||
### Why do some downloads still go through the original servers?
|
||||
### 为什么有些下载仍然通过原始服务器?
|
||||
|
||||
The extension only redirects recognized download links. Navigation links, preview links, and some dynamic content may not be redirected.
|
||||
扩展只重定向被识别的下载链接。导航链接、预览链接和一些动态内容可能不会被重定向。
|
||||
|
||||
### Is my browsing data collected?
|
||||
### 我的浏览数据会被收集吗?
|
||||
|
||||
No, the extension operates entirely locally. No browsing data is collected or transmitted. See our [Privacy Policy](PRIVACY_POLICY.md) for details.
|
||||
不会,扩展完全在本地运行。不收集或传输浏览数据。查看我们的 [隐私政策](PRIVACY_POLICY.md) 了解详情。
|
||||
|
||||
### How much faster are downloads?
|
||||
### 下载能快多少?
|
||||
|
||||
Speed improvements vary based on your location, network, and file size. Typical improvements range from 2x to 10x faster.
|
||||
速度提升因你的位置、网络和文件大小而异。典型的改进范围从 2 倍到 10 倍。
|
||||
|
||||
### Can I disable the extension for specific sites?
|
||||
### 我可以为特定网站禁用扩展吗?
|
||||
|
||||
Yes, use the per-platform toggles in the extension popup to disable acceleration for specific platforms.
|
||||
是的,使用扩展弹出窗口中的按平台切换开关来禁用特定平台的加速。
|
||||
|
||||
## 🌟 Show Your Support
|
||||
## 🌟 支持我们
|
||||
|
||||
If you find this extension helpful, please:
|
||||
如果你觉得这个扩展有用,请:
|
||||
|
||||
- ⭐ Star this repository
|
||||
- 📝 Leave a review on the [Chrome Web Store](https://chromewebstore.google.com/detail/ajiejgobfcifcikbahpijopolfjoodgf)
|
||||
- 🐛 Report bugs or suggest features via [GitHub Issues](https://github.com/xixu-me/Xget-for-Chrome/issues)
|
||||
- 📢 Share with others who might benefit from faster downloads
|
||||
- ⭐ 为此存储库点星
|
||||
- 📝 在 [Chrome 网上应用店](https://chromewebstore.google.com/detail/ajiejgobfcifcikbahpijopolfjoodgf) 留下评价
|
||||
- 🐛 通过 [GitHub Issues](https://github.com/xixu-me/Xget-for-Chrome/issues) 报告错误或建议功能
|
||||
- 📢 与其他可能受益于更快下载的人分享
|
||||
+43
-43
@@ -1,66 +1,66 @@
|
||||
# Security Policy
|
||||
# 安全政策
|
||||
|
||||
## Supported Versions
|
||||
## 支持的版本
|
||||
|
||||
We actively support the latest version of Xget for Chrome. Security updates are provided for:
|
||||
我们积极支持 Xget for Chrome 的最新版本。为以下版本提供安全更新:
|
||||
|
||||
| Version | Supported |
|
||||
| 版本 | 支持状态 |
|
||||
| ------- | ------------------ |
|
||||
| 1.x.x | :white_check_mark: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
## 报告漏洞
|
||||
|
||||
If you discover a security vulnerability in Xget for Chrome, please report it responsibly:
|
||||
如果你在 Xget for Chrome 中发现安全漏洞,请负责任地报告:
|
||||
|
||||
### How to Report
|
||||
### 如何报告
|
||||
|
||||
1. **Do not** create a public GitHub issue for security vulnerabilities
|
||||
2. Email the maintainer directly or create a private security advisory
|
||||
3. Include as much detail as possible:
|
||||
- Description of the vulnerability
|
||||
- Steps to reproduce
|
||||
- Potential impact
|
||||
- Suggested fix (if any)
|
||||
1. **不要** 为安全漏洞创建公开的 GitHub 问题
|
||||
2. 直接发邮件给维护者或创建私人安全咨询
|
||||
3. 包含尽可能多的详细信息:
|
||||
- 漏洞描述
|
||||
- 重现步骤
|
||||
- 潜在影响
|
||||
- 建议修复(如果有)
|
||||
|
||||
### What to Expect
|
||||
### 期望结果
|
||||
|
||||
- **Response Time**: We aim to respond within 48 hours
|
||||
- **Investigation**: We will investigate and assess the severity
|
||||
- **Fix Timeline**: Critical vulnerabilities will be patched within 7 days
|
||||
- **Disclosure**: We will coordinate responsible disclosure with you
|
||||
- **响应时间**:我们目标在 48 小时内响应
|
||||
- **调查**:我们将调查并评估严重性
|
||||
- **修复时间表**:关键漏洞将在 7 天内修补
|
||||
- **披露**:我们将与你协调负责任的披露
|
||||
|
||||
### Security Considerations
|
||||
### 安全考虑
|
||||
|
||||
This extension:
|
||||
此扩展:
|
||||
|
||||
- Processes URLs locally in your browser
|
||||
- Does not collect or transmit personal data
|
||||
- Uses Chrome's standard extension APIs
|
||||
- Redirects downloads through user-configured Xget domains
|
||||
- 在你的浏览器中本地处理 URL
|
||||
- 不收集或传输个人数据
|
||||
- 使用 Chrome 的标准扩展 API
|
||||
- 通过用户配置的 Xget 域名重定向下载
|
||||
|
||||
### Scope
|
||||
### 范围
|
||||
|
||||
Security issues we consider in scope:
|
||||
我们认为在范围内的安全问题:
|
||||
|
||||
- Code injection vulnerabilities
|
||||
- Privilege escalation
|
||||
- Data leakage or privacy violations
|
||||
- Malicious URL handling
|
||||
- Extension permission abuse
|
||||
- 代码注入漏洞
|
||||
- 权限提升
|
||||
- 数据泄露或隐私违规
|
||||
- 恶意 URL 处理
|
||||
- 扩展权限滥用
|
||||
|
||||
Out of scope:
|
||||
超出范围:
|
||||
|
||||
- Issues with third-party Xget servers
|
||||
- Browser-level vulnerabilities
|
||||
- Social engineering attacks
|
||||
- 第三方 Xget 服务器的问题
|
||||
- 浏览器级别的漏洞
|
||||
- 社会工程攻击
|
||||
|
||||
## Security Best Practices
|
||||
## 安全最佳实践
|
||||
|
||||
When using this extension:
|
||||
使用此扩展时:
|
||||
|
||||
- Only configure trusted Xget domains
|
||||
- Keep the extension updated
|
||||
- Review permissions when updating
|
||||
- Report suspicious behavior
|
||||
- 仅配置可信的 Xget 域名
|
||||
- 保持扩展更新
|
||||
- 更新时审查权限
|
||||
- 报告可疑行为
|
||||
|
||||
Thank you for helping keep Xget for Chrome secure!
|
||||
感谢你帮助保持 Xget for Chrome 的安全!
|
||||
+23
-23
@@ -1,4 +1,4 @@
|
||||
// Platform configurations matching the worker.js
|
||||
// 与 worker.js 匹配的平台配置
|
||||
const PLATFORMS = {
|
||||
gh: {
|
||||
base: "https://github.com",
|
||||
@@ -20,7 +20,7 @@ const PLATFORMS = {
|
||||
},
|
||||
};
|
||||
|
||||
// Default settings
|
||||
// 默认设置
|
||||
const DEFAULT_SETTINGS = {
|
||||
enabled: true,
|
||||
xgetDomain: "xget.xi-xu.me",
|
||||
@@ -31,16 +31,16 @@ const DEFAULT_SETTINGS = {
|
||||
},
|
||||
};
|
||||
|
||||
// Initialize extension
|
||||
// 初始化扩展
|
||||
chrome.runtime.onInstalled.addListener(async () => {
|
||||
console.log("Xget for Chrome installed");
|
||||
console.log("Xget for Chrome 已安装");
|
||||
|
||||
// Set default settings if not already set
|
||||
// 如果尚未设置,则设置默认设置
|
||||
const settings = await chrome.storage.sync.get(DEFAULT_SETTINGS);
|
||||
await chrome.storage.sync.set(settings);
|
||||
});
|
||||
|
||||
// Listen for download events
|
||||
// 监听下载事件
|
||||
chrome.downloads.onDeterminingFilename.addListener((downloadItem, suggest) => {
|
||||
handleDownload(downloadItem, suggest);
|
||||
});
|
||||
@@ -49,7 +49,7 @@ async function handleDownload(downloadItem, suggest) {
|
||||
try {
|
||||
const settings = await chrome.storage.sync.get(DEFAULT_SETTINGS);
|
||||
|
||||
// Check if extension is enabled and domain is configured
|
||||
// 检查扩展是否已启用并配置了域名
|
||||
if (!settings.enabled || !settings.xgetDomain) {
|
||||
suggest();
|
||||
return;
|
||||
@@ -59,39 +59,39 @@ async function handleDownload(downloadItem, suggest) {
|
||||
const redirectedUrl = transformUrl(url, settings);
|
||||
|
||||
if (redirectedUrl && redirectedUrl !== url) {
|
||||
console.log("Redirecting download:", url, "->", redirectedUrl);
|
||||
console.log("重定向下载:", url, "->", redirectedUrl);
|
||||
|
||||
// Cancel the original download
|
||||
// 取消原始下载
|
||||
chrome.downloads.cancel(downloadItem.id);
|
||||
|
||||
// Start new download with redirected URL
|
||||
// 使用重定向的 URL 开始新下载
|
||||
chrome.downloads.download({
|
||||
url: redirectedUrl,
|
||||
filename: downloadItem.filename || undefined,
|
||||
conflictAction: "uniquify",
|
||||
});
|
||||
|
||||
// Show notification via content script
|
||||
// 通过内容脚本显示通知
|
||||
try {
|
||||
await chrome.tabs.sendMessage(downloadItem.tabId, {
|
||||
action: "showNotification",
|
||||
message: "Download redirected through Xget",
|
||||
message: "下载已通过 Xget 重定向",
|
||||
});
|
||||
} catch (error) {
|
||||
console.log("Could not send notification to tab");
|
||||
console.log("无法向标签页发送通知");
|
||||
}
|
||||
} else {
|
||||
suggest();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error handling download:", error);
|
||||
console.error("处理下载时出错:", error);
|
||||
suggest();
|
||||
}
|
||||
}
|
||||
|
||||
function transformUrl(url, settings) {
|
||||
try {
|
||||
// Find matching platform
|
||||
// 找到匹配的平台
|
||||
for (const [platformKey, platform] of Object.entries(PLATFORMS)) {
|
||||
if (!settings.enabledPlatforms[platformKey]) continue;
|
||||
|
||||
@@ -99,27 +99,27 @@ function transformUrl(url, settings) {
|
||||
const urlObj = new URL(url);
|
||||
const path = urlObj.pathname + urlObj.search + urlObj.hash;
|
||||
|
||||
// Transform the URL using Xget domain (add https:// protocol)
|
||||
// 使用 Xget 域名转换 URL(添加 https:// 协议)
|
||||
const xgetUrl = `https://${settings.xgetDomain}/${platformKey}${path}`;
|
||||
return xgetUrl;
|
||||
}
|
||||
}
|
||||
|
||||
return null; // No transformation needed
|
||||
return null; // 不需要转换
|
||||
} catch (error) {
|
||||
console.error("Error transforming URL:", error);
|
||||
console.error("转换 URL 时出错:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Listen for messages from popup/options
|
||||
// 监听来自弹出窗口/选项的消息
|
||||
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
if (request.action === "getSettings") {
|
||||
chrome.storage.sync.get(DEFAULT_SETTINGS).then(sendResponse);
|
||||
return true;
|
||||
} else if (request.action === "saveSettings") {
|
||||
chrome.storage.sync.set(request.settings).then(async () => {
|
||||
// Notify relevant tabs to refresh
|
||||
// 通知相关标签页刷新
|
||||
try {
|
||||
const tabs = await chrome.tabs.query({
|
||||
url: [
|
||||
@@ -133,15 +133,15 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
try {
|
||||
await chrome.tabs.sendMessage(tab.id, {
|
||||
action: "showNotification",
|
||||
message: "Settings updated! Click to refresh page",
|
||||
message: "设置已更新!点击刷新页面",
|
||||
showRefreshButton: true,
|
||||
});
|
||||
} catch (error) {
|
||||
// Tab might not have content script loaded, ignore
|
||||
// 标签页可能没有加载内容脚本,忽略
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("Could not notify tabs about settings update");
|
||||
console.log("无法通知标签页设置更新");
|
||||
}
|
||||
|
||||
sendResponse({ success: true });
|
||||
|
||||
+46
-46
@@ -1,6 +1,6 @@
|
||||
// Content script to inject download interception on supported platforms
|
||||
// 内容脚本,在支持的平台上注入下载拦截功能
|
||||
|
||||
// Platform detection and URL transformation
|
||||
// 平台检测和 URL 转换
|
||||
const PLATFORMS = {
|
||||
gh: {
|
||||
base: "https://github.com",
|
||||
@@ -19,11 +19,11 @@ const PLATFORMS = {
|
||||
},
|
||||
};
|
||||
|
||||
// Initialize content script
|
||||
// 初始化内容脚本
|
||||
(async function () {
|
||||
console.log("Xget for Chrome: Content script loaded");
|
||||
console.log("Xget for Chrome:内容脚本已加载");
|
||||
|
||||
// Listen for messages from background script
|
||||
// 监听来自后台脚本的消息
|
||||
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
if (request.action === "showNotification") {
|
||||
showNotification(request.message, request.showRefreshButton);
|
||||
@@ -31,22 +31,22 @@ const PLATFORMS = {
|
||||
}
|
||||
});
|
||||
|
||||
// Check if extension is enabled and configured
|
||||
// 检查扩展是否已启用并配置
|
||||
const settings = await getSettings();
|
||||
if (!settings.enabled || !settings.xgetDomain) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Find current platform
|
||||
// 找到当前平台
|
||||
const currentPlatform = detectPlatform(window.location.href);
|
||||
if (!currentPlatform || !settings.enabledPlatforms[currentPlatform]) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Add download interception
|
||||
// 添加下载拦截
|
||||
interceptDownloadLinks();
|
||||
|
||||
// Monitor for dynamically added content
|
||||
// 监控动态添加的内容
|
||||
observePageChanges();
|
||||
})();
|
||||
|
||||
@@ -56,7 +56,7 @@ async function getSettings() {
|
||||
chrome.runtime.sendMessage({ action: "getSettings" }, resolve);
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Error getting settings:", error);
|
||||
console.error("获取设置时出错:", error);
|
||||
return { enabled: false };
|
||||
}
|
||||
}
|
||||
@@ -71,14 +71,14 @@ function detectPlatform(url) {
|
||||
}
|
||||
|
||||
function interceptDownloadLinks() {
|
||||
// Intercept clicks on download links
|
||||
// 拦截下载链接的点击事件
|
||||
document.addEventListener(
|
||||
"click",
|
||||
async (event) => {
|
||||
const link = event.target.closest("a");
|
||||
if (!link || !link.href) return;
|
||||
|
||||
// Check if this is a download link
|
||||
// 检查这是否是下载链接
|
||||
if (isDownloadLink(link)) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
@@ -95,12 +95,12 @@ function isDownloadLink(link) {
|
||||
const url = new URL(link.href);
|
||||
const pathname = url.pathname.toLowerCase();
|
||||
|
||||
// First check: explicit download attributes
|
||||
// 第一检查:明确的下载属性
|
||||
if (link.download || link.hasAttribute("download")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Second check: file extensions that indicate downloadable files
|
||||
// 第二检查:表示可下载文件的文件扩展名
|
||||
const fileExtensions = [
|
||||
".zip",
|
||||
".tar.gz",
|
||||
@@ -152,50 +152,50 @@ function isDownloadLink(link) {
|
||||
".nupkg",
|
||||
];
|
||||
|
||||
// Check if URL ends with a file extension
|
||||
// 检查 URL 是否以文件扩展名结尾
|
||||
if (fileExtensions.some((ext) => pathname.endsWith(ext))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Third check: GitHub-specific patterns
|
||||
// 第三检查:GitHub 特定模式
|
||||
const allowedGitHubHosts = ["github.com"];
|
||||
try {
|
||||
const parsedUrl = new URL(href);
|
||||
if (allowedGitHubHosts.includes(parsedUrl.host)) {
|
||||
// GitHub release asset download URLs follow pattern: /releases/download/
|
||||
// GitHub 发布资源下载 URL 遵循模式:/releases/download/
|
||||
if (pathname.includes("/releases/download/")) {
|
||||
return true;
|
||||
}
|
||||
// GitHub archive download URLs
|
||||
// GitHub 存档下载 URL
|
||||
if (
|
||||
pathname.includes("/archive/") &&
|
||||
(pathname.endsWith(".zip") || pathname.endsWith(".tar.gz"))
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
// GitHub raw file URLs - NEW: support for raw file links
|
||||
// GitHub 原始文件 URL - 新增:支持原始文件链接
|
||||
if (pathname.includes("/raw/")) {
|
||||
return true;
|
||||
}
|
||||
// Exclude navigation to releases page (just /releases or /releases/)
|
||||
// 排除导航到发布页面(仅 /releases 或 /releases/)
|
||||
if (pathname.endsWith("/releases") || pathname.endsWith("/releases/")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Invalid URL:", href, e);
|
||||
console.error("无效的 URL:", href, e);
|
||||
}
|
||||
|
||||
// Fourth check: GitLab-specific patterns
|
||||
// 第四检查:GitLab 特定模式
|
||||
const allowedGitLabHosts = ["gitlab.com"];
|
||||
try {
|
||||
const parsedUrl = new URL(href);
|
||||
if (allowedGitLabHosts.includes(parsedUrl.host)) {
|
||||
// GitLab archive downloads
|
||||
// GitLab 存档下载
|
||||
if (pathname.includes("/-/archive/")) {
|
||||
return true;
|
||||
}
|
||||
// GitLab release downloads
|
||||
// GitLab 发布下载
|
||||
if (
|
||||
pathname.includes("/-/releases/") &&
|
||||
pathname.includes("/downloads/")
|
||||
@@ -204,24 +204,24 @@ function isDownloadLink(link) {
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Invalid URL:", href, e);
|
||||
console.error("无效的 URL:", href, e);
|
||||
}
|
||||
|
||||
// Fifth check: Hugging Face file downloads
|
||||
// 第五检查:Hugging Face 文件下载
|
||||
const allowedHuggingFaceHosts = ["huggingface.co"];
|
||||
try {
|
||||
const parsedUrl = new URL(href);
|
||||
if (allowedHuggingFaceHosts.includes(parsedUrl.host)) {
|
||||
// HF file download URLs contain /resolve/
|
||||
// HF 文件下载 URL 包含 /resolve/
|
||||
if (pathname.includes("/resolve/")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Invalid URL:", href, e);
|
||||
console.error("无效的 URL:", href, e);
|
||||
}
|
||||
|
||||
// Seventh check: explicit download text indicators (be more specific)
|
||||
// 第七检查:明确的下载文本指示器(更具体)
|
||||
const downloadTextIndicators = ["download", "download file", "get file"];
|
||||
const linkText = link.textContent.toLowerCase().trim();
|
||||
if (
|
||||
@@ -233,7 +233,7 @@ function isDownloadLink(link) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Default: not a download link
|
||||
// 默认:不是下载链接
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -244,14 +244,14 @@ async function handleDownloadLink(url) {
|
||||
|
||||
const transformedUrl = transformUrl(url, settings);
|
||||
if (transformedUrl) {
|
||||
// Show notification
|
||||
showNotification(`Download redirected through Xget`);
|
||||
// 显示通知
|
||||
showNotification(`下载已通过 Xget 重定向`);
|
||||
|
||||
// Trigger download
|
||||
// 触发下载
|
||||
window.location.href = transformedUrl;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error handling download:", error);
|
||||
console.error("处理下载时出错:", error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,14 +267,14 @@ function transformUrl(url, settings) {
|
||||
|
||||
return `https://${settings.xgetDomain}/${platform}${path}`;
|
||||
} catch (error) {
|
||||
console.error("Error transforming URL:", error);
|
||||
console.error("转换 URL 时出错:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function observePageChanges() {
|
||||
const observer = new MutationObserver(() => {
|
||||
// Monitor for page changes (no additional actions needed)
|
||||
// 监控页面变化(无需额外操作)
|
||||
});
|
||||
|
||||
observer.observe(document.body, {
|
||||
@@ -285,25 +285,25 @@ function observePageChanges() {
|
||||
|
||||
function showNotification(message, showRefreshButton = false) {
|
||||
try {
|
||||
// Remove any existing notifications first
|
||||
// 首先删除所有现有通知
|
||||
const existingNotifications =
|
||||
document.querySelectorAll(".xget-notification");
|
||||
existingNotifications.forEach((notification) => notification.remove());
|
||||
|
||||
// Create a simple notification
|
||||
// 创建一个简单的通知
|
||||
const notification = document.createElement("div");
|
||||
notification.className = "xget-notification";
|
||||
|
||||
// Create message container
|
||||
// 创建消息容器
|
||||
const messageDiv = document.createElement("div");
|
||||
messageDiv.textContent = message;
|
||||
messageDiv.style.marginBottom = showRefreshButton ? "8px" : "0";
|
||||
notification.appendChild(messageDiv);
|
||||
|
||||
// Add refresh button if needed
|
||||
// 如果需要,添加刷新按钮
|
||||
if (showRefreshButton) {
|
||||
const refreshButton = document.createElement("button");
|
||||
refreshButton.textContent = "🔄 Refresh Page";
|
||||
refreshButton.textContent = "🔄 刷新页面";
|
||||
refreshButton.style.cssText = `
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
@@ -350,7 +350,7 @@ function showNotification(message, showRefreshButton = false) {
|
||||
word-wrap: break-word;
|
||||
`;
|
||||
|
||||
// Add animation styles if not already present
|
||||
// 如果尚未存在则添加动画样式
|
||||
if (!document.getElementById("xget-notification-styles")) {
|
||||
const style = document.createElement("style");
|
||||
style.id = "xget-notification-styles";
|
||||
@@ -369,7 +369,7 @@ function showNotification(message, showRefreshButton = false) {
|
||||
|
||||
document.body.appendChild(notification);
|
||||
|
||||
// Remove after longer time if has refresh button, shorter if not
|
||||
// 如果有刷新按钮则在较长时间后删除,否则在较短时间后删除
|
||||
const removeDelay = showRefreshButton ? 8000 : 4000;
|
||||
setTimeout(() => {
|
||||
notification.style.animation = "xgetSlideOut 0.3s ease-in";
|
||||
@@ -380,8 +380,8 @@ function showNotification(message, showRefreshButton = false) {
|
||||
}, 300);
|
||||
}, removeDelay);
|
||||
} catch (error) {
|
||||
console.error("Error showing notification:", error);
|
||||
// Fallback to console log if DOM manipulation fails
|
||||
console.log("Xget notification:", message);
|
||||
console.error("显示通知时出错:", error);
|
||||
// 如果 DOM 操作失败则回退到控制台日志
|
||||
console.log("Xget 通知:", message);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -25,7 +25,7 @@
|
||||
"run_at": "document_end"
|
||||
}
|
||||
],
|
||||
"description": "Download accelerator that redirects downloads through Xget for faster speeds",
|
||||
"description": "通过 Xget 重定向下载实现加速的下载器扩展",
|
||||
"host_permissions": [
|
||||
"https://github.com/*",
|
||||
"https://gitlab.com/*",
|
||||
@@ -44,7 +44,7 @@
|
||||
"storage",
|
||||
"activeTab"
|
||||
],
|
||||
"version": "1.1.0",
|
||||
"version": "1.2.0",
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"matches": [
|
||||
|
||||
+7
-7
@@ -5,7 +5,7 @@
|
||||
"url": "https://github.com/xixu-me/Xget-for-Chrome/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Chrome extension that accelerates downloads by redirecting them through Xget",
|
||||
"description": "通过 Xget 重定向下载实现加速的 Chrome 扩展",
|
||||
"devDependencies": {},
|
||||
"homepage": "https://github.com/xixu-me/Xget-for-Chrome#readme",
|
||||
"keywords": [
|
||||
@@ -26,14 +26,14 @@
|
||||
"url": "https://github.com/xixu-me/Xget-for-Chrome.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "echo 'No build process required - extension runs from source'",
|
||||
"build": "不需要构建过程 - 扩展直接从源码运行",
|
||||
"clean": "rm -f *.zip",
|
||||
"dev": "echo 'Open chrome://extensions/ and load unpacked extension'",
|
||||
"lint": "echo 'No linting configured - consider adding ESLint for JavaScript files'",
|
||||
"dev": "打开 chrome://extensions/ 并加载解压的扩展",
|
||||
"lint": "未配置代码检查 - 建议为 JavaScript 文件添加 ESLint",
|
||||
"package": "zip -r extension.zip . -x '*.git*' 'node_modules/*' '.github/*' '*.md' 'LICENSE' '*.zip'",
|
||||
"release": "npm run validate && npm run package",
|
||||
"test": "echo 'Load extension in Chrome Developer Mode to test'",
|
||||
"validate": "node -e \"JSON.parse(require('fs').readFileSync('manifest.json', 'utf8')); console.log('✅ manifest.json is valid')\""
|
||||
"test": "在 Chrome 开发者模式下加载扩展进行测试",
|
||||
"validate": "node -e \"JSON.parse(require('fs').readFileSync('manifest.json', 'utf8')); console.log('✅ manifest.json 格式有效')\""
|
||||
},
|
||||
"version": "1.1.0"
|
||||
"version": "1.2.0"
|
||||
}
|
||||
+7
-9
@@ -212,7 +212,7 @@
|
||||
<body>
|
||||
<div class="header">
|
||||
<h1>Xget for Chrome</h1>
|
||||
<div class="subtitle">Download Accelerator</div>
|
||||
<div class="subtitle">下载加速器</div>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
@@ -225,7 +225,7 @@
|
||||
justify-content: space-between;
|
||||
"
|
||||
>
|
||||
Enable Extension
|
||||
启用扩展
|
||||
<label class="toggle-switch">
|
||||
<input type="checkbox" id="enabledToggle" />
|
||||
<span class="slider"></span>
|
||||
@@ -235,19 +235,17 @@
|
||||
</div>
|
||||
|
||||
<div class="setting-group">
|
||||
<label class="setting-label" for="domainInput"
|
||||
>Xget Domain (Required)</label
|
||||
>
|
||||
<label class="setting-label" for="domainInput">Xget 域名(必填)</label>
|
||||
<input
|
||||
type="text"
|
||||
id="domainInput"
|
||||
class="domain-input"
|
||||
placeholder="your-xget-domain.com"
|
||||
placeholder="你的-xget-域名.com"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="setting-group">
|
||||
<label class="setting-label">Enabled Platforms</label>
|
||||
<label class="setting-label">启用的平台</label>
|
||||
<div class="platforms">
|
||||
<div class="platform-item">
|
||||
<span>GitHub</span>
|
||||
@@ -281,7 +279,7 @@
|
||||
class="link-item"
|
||||
>
|
||||
<span class="link-icon">🚀</span>
|
||||
<span class="link-text">Deploy Your Own Xget Service</span>
|
||||
<span class="link-text">部署你自己的 Xget 服务</span>
|
||||
</a>
|
||||
<a
|
||||
href="https://github.com/xixu-me/Xget-for-Chrome"
|
||||
@@ -289,7 +287,7 @@
|
||||
class="link-item"
|
||||
>
|
||||
<span class="link-icon">📖</span>
|
||||
<span class="link-text">Source Code & Documentation</span>
|
||||
<span class="link-text">源码和文档</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
document.addEventListener("DOMContentLoaded", async () => {
|
||||
// Load current settings
|
||||
// 加载当前设置
|
||||
await loadSettings();
|
||||
|
||||
// Set up event listeners
|
||||
// 设置事件监听器
|
||||
setupEventListeners();
|
||||
});
|
||||
|
||||
@@ -12,38 +12,38 @@ async function loadSettings() {
|
||||
action: "getSettings",
|
||||
});
|
||||
|
||||
// Update UI with current settings
|
||||
// 使用当前设置更新 UI
|
||||
const domainValue = settings.xgetDomain || "";
|
||||
document.getElementById("domainInput").value = domainValue;
|
||||
|
||||
// Only enable the toggle if domain is set
|
||||
// 仅在设置了域名时启用切换
|
||||
const enabledValue = settings.enabled && domainValue.trim() !== "";
|
||||
document.getElementById("enabledToggle").checked = enabledValue;
|
||||
|
||||
// Update platform toggles
|
||||
// 更新平台切换
|
||||
document.getElementById("ghToggle").checked = settings.enabledPlatforms.gh;
|
||||
document.getElementById("glToggle").checked = settings.enabledPlatforms.gl;
|
||||
document.getElementById("hfToggle").checked = settings.enabledPlatforms.hf;
|
||||
|
||||
// Show status if domain is missing
|
||||
// 如果缺少域名则显示状态
|
||||
if (!domainValue && settings.enabled) {
|
||||
showStatus("Please configure your Xget domain", "error");
|
||||
showStatus("请配置你的 Xget 域名", "error");
|
||||
} else if (domainValue && enabledValue) {
|
||||
showStatus("Extension is active and ready", "success");
|
||||
showStatus("扩展已激活并准备就绪", "success");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error loading settings:", error);
|
||||
showStatus("Error loading settings", "error");
|
||||
console.error("加载设置时出错:", error);
|
||||
showStatus("加载设置时出错", "error");
|
||||
}
|
||||
}
|
||||
|
||||
function setupEventListeners() {
|
||||
// Enable/disable toggle
|
||||
// 启用/禁用切换
|
||||
document
|
||||
.getElementById("enabledToggle")
|
||||
.addEventListener("change", handleEnableToggle);
|
||||
|
||||
// Domain input
|
||||
// 域名输入
|
||||
document
|
||||
.getElementById("domainInput")
|
||||
.addEventListener("input", debounce(handleDomainChange, 500));
|
||||
@@ -51,7 +51,7 @@ function setupEventListeners() {
|
||||
.getElementById("domainInput")
|
||||
.addEventListener("blur", validateDomain);
|
||||
|
||||
// Platform toggles
|
||||
// 平台切换
|
||||
document.getElementById("ghToggle").addEventListener("change", saveSettings);
|
||||
document.getElementById("glToggle").addEventListener("change", saveSettings);
|
||||
document.getElementById("hfToggle").addEventListener("change", saveSettings);
|
||||
@@ -62,10 +62,10 @@ async function saveSettings() {
|
||||
const domainValue = document.getElementById("domainInput").value.trim();
|
||||
const enabledValue = document.getElementById("enabledToggle").checked;
|
||||
|
||||
// Prevent enabling if no domain is set
|
||||
// 如果没有设置域名则防止启用
|
||||
if (enabledValue && !domainValue) {
|
||||
document.getElementById("enabledToggle").checked = false;
|
||||
showStatus("Cannot enable extension without a domain", "error");
|
||||
showStatus("没有域名不能启用扩展", "error");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ async function saveSettings() {
|
||||
},
|
||||
};
|
||||
|
||||
// Clean up domain URL
|
||||
// 清理域名 URL
|
||||
if (settings.xgetDomain) {
|
||||
settings.xgetDomain = cleanupDomain(settings.xgetDomain);
|
||||
}
|
||||
@@ -90,49 +90,43 @@ async function saveSettings() {
|
||||
});
|
||||
|
||||
if (response.success) {
|
||||
// Show appropriate status
|
||||
// 显示适当的状态
|
||||
if (!settings.xgetDomain && settings.enabled) {
|
||||
showStatus("Please configure your Xget domain", "error");
|
||||
showStatus("请配置你的 Xget 域名", "error");
|
||||
} else if (settings.xgetDomain && settings.enabled) {
|
||||
showStatus(
|
||||
"✅ Settings saved! Check page notifications for refresh button",
|
||||
"success"
|
||||
);
|
||||
showStatus("✅ 设置已保存!查看页面通知中的刷新按钮", "success");
|
||||
} else {
|
||||
showStatus(
|
||||
"✅ Settings saved! Check page notifications for refresh button",
|
||||
"success"
|
||||
);
|
||||
showStatus("✅ 设置已保存!查看页面通知中的刷新按钮", "success");
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error saving settings:", error);
|
||||
showStatus("Error saving settings", "error");
|
||||
console.error("保存设置时出错:", error);
|
||||
showStatus("保存设置时出错", "error");
|
||||
}
|
||||
}
|
||||
|
||||
function validateDomain() {
|
||||
const domain = document.getElementById("domainInput").value.trim();
|
||||
if (domain && !isValidDomain(domain)) {
|
||||
showStatus("Invalid domain format", "error");
|
||||
showStatus("域名格式无效", "error");
|
||||
}
|
||||
}
|
||||
|
||||
function cleanupDomain(domain) {
|
||||
// Remove any protocol if accidentally included
|
||||
// 如果意外包含协议,则删除它
|
||||
domain = domain.replace(/^https?:\/\//, "");
|
||||
|
||||
// Remove trailing slash
|
||||
// 删除末尾斜杠
|
||||
domain = domain.replace(/\/$/, "");
|
||||
|
||||
return domain;
|
||||
}
|
||||
|
||||
function isValidDomain(domain) {
|
||||
// Remove protocol if present
|
||||
// 如果存在协议则删除它
|
||||
domain = domain.replace(/^https?:\/\//, "");
|
||||
|
||||
// Basic domain validation pattern
|
||||
// 基本域名验证模式
|
||||
const domainPattern =
|
||||
/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
||||
|
||||
@@ -154,7 +148,7 @@ function showStatus(message, type) {
|
||||
statusElement.className = `status ${type}`;
|
||||
statusElement.style.display = "block";
|
||||
|
||||
// Auto-hide success messages
|
||||
// 自动隐藏成功消息
|
||||
if (type === "success") {
|
||||
setTimeout(hideStatus, 3000);
|
||||
}
|
||||
@@ -182,9 +176,9 @@ async function handleEnableToggle() {
|
||||
const domainInput = document.getElementById("domainInput");
|
||||
|
||||
if (enabledToggle.checked && !domainInput.value.trim()) {
|
||||
// Prevent enabling if no domain is set
|
||||
// 如果没有设置域名则防止启用
|
||||
enabledToggle.checked = false;
|
||||
showStatus("Please configure your Xget domain before enabling", "error");
|
||||
showStatus("启用前请配置你的 Xget 域名", "error");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -195,10 +189,10 @@ async function handleDomainChange() {
|
||||
const domainInput = document.getElementById("domainInput");
|
||||
const enabledToggle = document.getElementById("enabledToggle");
|
||||
|
||||
// If domain is cleared and extension is enabled, disable it
|
||||
// 如果域名被清空且扩展已启用,则禁用它
|
||||
if (!domainInput.value.trim() && enabledToggle.checked) {
|
||||
enabledToggle.checked = false;
|
||||
showStatus("Extension disabled: domain cleared", "error");
|
||||
showStatus("扩展已禁用:域名已清空", "error");
|
||||
}
|
||||
|
||||
await saveSettings();
|
||||
|
||||
Reference in new issue
Block a user