feat: initialize gomdown-helper with yt-dlp transfer flow
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
dist
|
||||
.DS_Store
|
||||
14
README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Gomdown-helper
|
||||
|
||||
Vite + React + TypeScript + Manifest V3 기반 gdown 브라우저 확장 프로젝트입니다.
|
||||
|
||||
## Commands
|
||||
|
||||
- `npm install`
|
||||
- `npm run dev` (개발 모드)
|
||||
- `npm run build` (프로덕션 번들)
|
||||
|
||||
## Notes
|
||||
|
||||
- Native Messaging Host 이름은 `org.gdown.nativehost`를 사용합니다.
|
||||
- 설정은 `chrome.storage.sync`에 저장됩니다.
|
||||
43
docs/MEDIA_CAPTURE_PLAN.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# Media Capture Implementation Plan (Commercial Grade)
|
||||
|
||||
## Goal
|
||||
- 웹페이지에서 노출되는 `mp4`, `m3u8`, `hls` 계열 URL을 안정적으로 수집하고,
|
||||
- 사용자에게 캡처 목록을 제공한 뒤,
|
||||
- 선택 URL을 `gdown`(native host -> addUri)로 전송한다.
|
||||
|
||||
## Product Requirements
|
||||
1. 탐지 신뢰성
|
||||
- 단순 확장자 기반 + `content-type` 기반 병행
|
||||
- `webRequest` 레벨에서 응답 헤더 관찰
|
||||
- 중복 제거(동일 URL/동일 탭 다중 발생 억제)
|
||||
|
||||
2. UX
|
||||
- 팝업에서 최근 캡처 목록 확인 가능
|
||||
- 항목별 즉시 전송 버튼
|
||||
- 전체 비우기
|
||||
- 상태/실패 사유 표시
|
||||
|
||||
3. 운영/확장성
|
||||
- 캡처 저장소 분리 (`storage.local`)
|
||||
- 타입/모델 분리
|
||||
- 향후 DASH(`.mpd`), DRM 힌트 감지 등 단계적 확장 가능
|
||||
|
||||
## Step-by-Step
|
||||
1. Step 1 (이번 구현)
|
||||
- `webRequest.onHeadersReceived` 기반 캡처 엔진
|
||||
- mp4/m3u8/m3u/hls mime 감지
|
||||
- 팝업 목록 + Add/Clear
|
||||
- 페이지 URL -> `yt-dlp` 전송(현재 탭 버튼, 우클릭 페이지 fallback)
|
||||
|
||||
2. Step 2
|
||||
- content script 보조 탐지(video/source/player script)
|
||||
- referer/cookie/user-agent 전달 강화
|
||||
|
||||
3. Step 3
|
||||
- 사이트별 노이즈 필터링 룰
|
||||
- 품질별 그룹핑/정렬
|
||||
- 실패 자동 재시도 UX
|
||||
|
||||
4. Step 4
|
||||
- 고급모드(세그먼트 playlist vs master playlist 구분)
|
||||
- 진단 로그 뷰
|
||||
11
docs/TODO.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# TODO
|
||||
|
||||
## Media Capture
|
||||
- [x] 계획서 작성 (`docs/MEDIA_CAPTURE_PLAN.md`)
|
||||
- [x] Step 1: Service Worker 미디어 캡처 엔진 구현
|
||||
- [x] Step 1: 팝업 캡처 목록/전송 UI 구현
|
||||
- [x] Step 1: 빌드 및 수동 테스트
|
||||
- [x] Step 1.5: 페이지 URL(현재 탭/우클릭 페이지) `yt-dlp` 전송 경로 추가
|
||||
- [ ] Step 2: content script 보조 탐지
|
||||
- [ ] Step 3: 노이즈 필터/품질 그룹핑
|
||||
- [ ] Step 4: 고급 분석/진단 UI
|
||||
44
manifest.config.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import { defineManifest } from '@crxjs/vite-plugin';
|
||||
export default defineManifest({
|
||||
manifest_version: 3,
|
||||
name: 'Gomdown Helper',
|
||||
description: 'Send browser downloads to gdown',
|
||||
version: '0.0.1',
|
||||
default_locale: 'en',
|
||||
icons: {
|
||||
'16': 'images/16.png',
|
||||
'32': 'images/32.png',
|
||||
'48': 'images/48.png',
|
||||
'128': 'images/128.png',
|
||||
},
|
||||
background: {
|
||||
service_worker: 'src/background/index.ts',
|
||||
type: 'module',
|
||||
},
|
||||
action: {
|
||||
default_popup: 'src/popup/index.html',
|
||||
default_title: 'Gomdown Helper',
|
||||
default_icon: {
|
||||
'16': 'images/16.png',
|
||||
'32': 'images/32.png',
|
||||
'48': 'images/48.png',
|
||||
'128': 'images/128.png',
|
||||
},
|
||||
},
|
||||
content_scripts: [
|
||||
{
|
||||
matches: ['<all_urls>'],
|
||||
js: ['src/content/index.ts'],
|
||||
run_at: 'document_start',
|
||||
all_frames: true,
|
||||
},
|
||||
],
|
||||
permissions: ['downloads', 'downloads.shelf', 'notifications', 'storage', 'contextMenus', 'cookies', 'webRequest', 'nativeMessaging'],
|
||||
host_permissions: ['<all_urls>'],
|
||||
web_accessible_resources: [
|
||||
{
|
||||
resources: ['images/*'],
|
||||
matches: ['<all_urls>'],
|
||||
},
|
||||
],
|
||||
});
|
||||
47
manifest.config.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import { defineManifest } from '@crxjs/vite-plugin'
|
||||
import pkg from './package.json'
|
||||
|
||||
export default defineManifest({
|
||||
manifest_version: 3,
|
||||
name: 'Gomdown Helper',
|
||||
description: 'Send browser downloads to gdown',
|
||||
version: pkg.version,
|
||||
default_locale: 'en',
|
||||
icons: {
|
||||
'16': 'images/16.png',
|
||||
'32': 'images/32.png',
|
||||
'48': 'images/48.png',
|
||||
'128': 'images/128.png',
|
||||
},
|
||||
background: {
|
||||
service_worker: 'src/background/index.ts',
|
||||
type: 'module',
|
||||
},
|
||||
action: {
|
||||
default_popup: 'src/popup/index.html',
|
||||
default_title: 'Gomdown Helper',
|
||||
default_icon: {
|
||||
'16': 'images/16.png',
|
||||
'32': 'images/32.png',
|
||||
'48': 'images/48.png',
|
||||
'128': 'images/128.png',
|
||||
},
|
||||
},
|
||||
options_page: 'src/config/index.html',
|
||||
content_scripts: [
|
||||
{
|
||||
matches: ['<all_urls>'],
|
||||
js: ['src/content/index.ts'],
|
||||
run_at: 'document_start',
|
||||
all_frames: true,
|
||||
},
|
||||
],
|
||||
permissions: ['downloads', 'downloads.shelf', 'notifications', 'storage', 'contextMenus', 'cookies', 'webRequest', 'nativeMessaging'],
|
||||
host_permissions: ['<all_urls>'],
|
||||
web_accessible_resources: [
|
||||
{
|
||||
resources: ['images/*'],
|
||||
matches: ['<all_urls>'],
|
||||
},
|
||||
],
|
||||
})
|
||||
2799
package-lock.json
generated
Normal file
34
package.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "gomdown-helper",
|
||||
"private": true,
|
||||
"version": "0.0.10",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"prebuild": "node scripts/version-bump.mjs",
|
||||
"build": "tsc -b && vite build",
|
||||
"preview": "vite preview",
|
||||
"build:chrome": "npm run build && node scripts/build-platform.mjs chrome",
|
||||
"build:edge": "npm run build && node scripts/build-platform.mjs edge",
|
||||
"build:firefox": "npm run build && node scripts/build-platform.mjs firefox",
|
||||
"build:all": "npm run build && node scripts/build-platform.mjs all"
|
||||
},
|
||||
"dependencies": {
|
||||
"aria2": "^4.1.2",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"webextension-polyfill": "^0.12.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@crxjs/vite-plugin": "^2.0.3",
|
||||
"@types/chrome": "^0.0.290",
|
||||
"@types/node": "^24.10.1",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"@types/webextension-polyfill": "^0.12.1",
|
||||
"@vitejs/plugin-react": "^4.3.3",
|
||||
"type-fest": "^4.40.0",
|
||||
"typescript": "~5.9.3",
|
||||
"vite": "^7.3.1"
|
||||
}
|
||||
}
|
||||
83
packages/chrome/.vite/manifest.json
Normal file
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"../../../../../@crx/manifest": {
|
||||
"file": "assets/crx-manifest.js--9ZsUvq0.js",
|
||||
"name": "crx-manifest.js",
|
||||
"src": "../../../../../@crx/manifest",
|
||||
"isEntry": true
|
||||
},
|
||||
"_browser-polyfill-CZ_dLIqp.js": {
|
||||
"file": "assets/browser-polyfill-CZ_dLIqp.js",
|
||||
"name": "browser-polyfill"
|
||||
},
|
||||
"_client-CBvt1tWS.js": {
|
||||
"file": "assets/client-CBvt1tWS.js",
|
||||
"name": "client",
|
||||
"imports": [
|
||||
"_browser-polyfill-CZ_dLIqp.js"
|
||||
]
|
||||
},
|
||||
"_downloadIntent-Dv31jC2S.js": {
|
||||
"file": "assets/downloadIntent-Dv31jC2S.js",
|
||||
"name": "downloadIntent"
|
||||
},
|
||||
"_index.ts-loader-DMyyuf2n.js": {
|
||||
"file": "assets/index.ts-loader-DMyyuf2n.js",
|
||||
"src": "_index.ts-loader-DMyyuf2n.js"
|
||||
},
|
||||
"_settings-Bo6W9Drl.js": {
|
||||
"file": "assets/settings-Bo6W9Drl.js",
|
||||
"name": "settings",
|
||||
"imports": [
|
||||
"_browser-polyfill-CZ_dLIqp.js"
|
||||
]
|
||||
},
|
||||
"src/background/index.ts": {
|
||||
"file": "assets/index.ts-U2ACoZ75.js",
|
||||
"name": "index.ts",
|
||||
"src": "src/background/index.ts",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_browser-polyfill-CZ_dLIqp.js",
|
||||
"_downloadIntent-Dv31jC2S.js",
|
||||
"_settings-Bo6W9Drl.js"
|
||||
]
|
||||
},
|
||||
"src/config/index.html": {
|
||||
"file": "assets/index.html-B0Kfv8fq.js",
|
||||
"name": "index.html",
|
||||
"src": "src/config/index.html",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_client-CBvt1tWS.js",
|
||||
"_settings-Bo6W9Drl.js",
|
||||
"_browser-polyfill-CZ_dLIqp.js"
|
||||
],
|
||||
"css": [
|
||||
"assets/index-B2D5FcJM.css"
|
||||
]
|
||||
},
|
||||
"src/content/index.ts": {
|
||||
"file": "assets/index.ts-BGLNJwsP.js",
|
||||
"name": "index.ts",
|
||||
"src": "src/content/index.ts",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_browser-polyfill-CZ_dLIqp.js",
|
||||
"_downloadIntent-Dv31jC2S.js"
|
||||
]
|
||||
},
|
||||
"src/popup/index.html": {
|
||||
"file": "assets/index.html-Tb8yZAds.js",
|
||||
"name": "index.html",
|
||||
"src": "src/popup/index.html",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_client-CBvt1tWS.js",
|
||||
"_browser-polyfill-CZ_dLIqp.js",
|
||||
"_settings-Bo6W9Drl.js"
|
||||
],
|
||||
"css": [
|
||||
"assets/index-D6aWDpYY.css"
|
||||
]
|
||||
}
|
||||
}
|
||||
86
packages/chrome/_locales/en/messages.json
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"appName": {
|
||||
"message": "Motrix WebExtension",
|
||||
"description": "The name of the application"
|
||||
},
|
||||
"appShortName": {
|
||||
"message": "Motrix WebExt",
|
||||
"description": "The short_name (maximum of 12 characters recommended) is a short version of the app's name."
|
||||
},
|
||||
"appDescription": {
|
||||
"message": "WebExtension for Motrix download manager",
|
||||
"description": "The description of the application"
|
||||
},
|
||||
"browserActionTitle": {
|
||||
"message": "Motrix WebExtension",
|
||||
"description": "The title of the browser action button"
|
||||
},
|
||||
"extensionStatus": {
|
||||
"message": "Extension status:",
|
||||
"description": "Extension status"
|
||||
},
|
||||
"enableNotifications": {
|
||||
"message": "Enable notifications:",
|
||||
"description": "Enable Notifications"
|
||||
},
|
||||
"setKey": {
|
||||
"message": "Set Key",
|
||||
"description": "Set Key"
|
||||
},
|
||||
"setMinSize": {
|
||||
"message": "Set minimum file size (mb)",
|
||||
"description": "Set minimum file size"
|
||||
},
|
||||
"setSize": {
|
||||
"message": "Set size",
|
||||
"description": "Set size"
|
||||
},
|
||||
"keyInputPlaceholder": {
|
||||
"message": "Motrix API Key",
|
||||
"description": "Motrix API Key"
|
||||
},
|
||||
"blacklist": {
|
||||
"message": "Blacklist",
|
||||
"description": "Blacklist"
|
||||
},
|
||||
"saveBlacklist": {
|
||||
"message": "Save blacklist",
|
||||
"description": "Save blacklist"
|
||||
},
|
||||
"darkMode": {
|
||||
"message": "Dark mode",
|
||||
"description": "Dark mode"
|
||||
},
|
||||
"showOnlyAria": {
|
||||
"message": "Show only Motrix downloads in the popup",
|
||||
"description": "Show only Motrix downloads in the popup"
|
||||
},
|
||||
"hideChromeBar": {
|
||||
"message": "Hide chrome download bar",
|
||||
"description": "Hide chrome download bar"
|
||||
},
|
||||
"showContextOption": {
|
||||
"message": "Show \"Download with gdown\" context option",
|
||||
"description": "Show \"Download with gdown\" context option"
|
||||
},
|
||||
"downloadWithMotrix": {
|
||||
"message": "Download with gdown",
|
||||
"description": "Download with gdown"
|
||||
},
|
||||
"setPort": {
|
||||
"message": "Set Port",
|
||||
"description": "Set Port"
|
||||
},
|
||||
"downloadFallback": {
|
||||
"message": "If launching in gdown fails, use the browser's default download manager",
|
||||
"description": "If launching in gdown fails, use the browser's default download manager"
|
||||
},
|
||||
"useNativeHost": {
|
||||
"message": "Use Native Messaging host for downloads",
|
||||
"description": "Use Native Messaging host for downloads"
|
||||
},
|
||||
"activateAppOnDownload": {
|
||||
"message": "Activate gdown app when transfer starts",
|
||||
"description": "Activate gdown app when transfer starts"
|
||||
}
|
||||
}
|
||||
86
packages/chrome/_locales/zh/messages.json
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"appName": {
|
||||
"message": "Motrix 网页扩展",
|
||||
"description": "应用程序名称"
|
||||
},
|
||||
"appShortName": {
|
||||
"message": "Motrix 扩展",
|
||||
"description": "应用程序缩略名称"
|
||||
},
|
||||
"appDescription": {
|
||||
"message": "用于 Motrix 下载管理器的网页扩展",
|
||||
"description": "应用程序描述"
|
||||
},
|
||||
"browserActionTitle": {
|
||||
"message": "Motrix 网页扩展",
|
||||
"description": "浏览器操作按钮标题"
|
||||
},
|
||||
"extensionStatus": {
|
||||
"message": "扩展状态",
|
||||
"description": "扩展状态"
|
||||
},
|
||||
"enableNotifications": {
|
||||
"message": "允许桌面通知",
|
||||
"description": "允许桌面通知"
|
||||
},
|
||||
"setKey": {
|
||||
"message": "设置密钥",
|
||||
"description": "设置密钥"
|
||||
},
|
||||
"setMinSize": {
|
||||
"message": "设置最小下载文件 (mb)",
|
||||
"description": "设置最小下载文件"
|
||||
},
|
||||
"setSize": {
|
||||
"message": "设置大小",
|
||||
"description": "设置大小"
|
||||
},
|
||||
"keyInputPlaceholder": {
|
||||
"message": "Motrix API 密钥",
|
||||
"description": "Motrix API 密钥"
|
||||
},
|
||||
"blacklist": {
|
||||
"message": "黑名单",
|
||||
"description": "黑名单"
|
||||
},
|
||||
"saveBlacklist": {
|
||||
"message": "保存黑名单",
|
||||
"description": "保存黑名单"
|
||||
},
|
||||
"darkMode": {
|
||||
"message": "深色模式",
|
||||
"description": "深色模式"
|
||||
},
|
||||
"showOnlyAria": {
|
||||
"message": "在弹出窗口中仅显示 Motrix 下载",
|
||||
"description": "在弹出窗口中仅显示 Motrix 下载"
|
||||
},
|
||||
"hideChromeBar": {
|
||||
"message": "隐藏 Chrome 下载栏",
|
||||
"description": "隐藏 Chrome 下载栏"
|
||||
},
|
||||
"showContextOption": {
|
||||
"message": "显示“使用 gdown 下载”右键选项",
|
||||
"description": "显示“使用 gdown 下载”右键选项"
|
||||
},
|
||||
"downloadWithMotrix": {
|
||||
"message": "使用 gdown 下载",
|
||||
"description": "使用 gdown 下载"
|
||||
},
|
||||
"setPort": {
|
||||
"message": "设置端口",
|
||||
"description": "设置端口"
|
||||
},
|
||||
"downloadFallback": {
|
||||
"message": "如果 gdown 启动失败,则使用浏览器的默认下载管理器",
|
||||
"description": "如果 gdown 启动失败,则使用浏览器的默认下载管理器"
|
||||
},
|
||||
"useNativeHost": {
|
||||
"message": "使用 Native Messaging 主机传输下载",
|
||||
"description": "使用 Native Messaging 主机传输下载"
|
||||
},
|
||||
"activateAppOnDownload": {
|
||||
"message": "下载转交时激活 gdown 应用",
|
||||
"description": "下载转交时激活 gdown 应用"
|
||||
}
|
||||
}
|
||||
1
packages/chrome/assets/browser-polyfill-CZ_dLIqp.js
Normal file
8
packages/chrome/assets/client-CBvt1tWS.js
Normal file
1
packages/chrome/assets/downloadIntent-Dv31jC2S.js
Normal file
@@ -0,0 +1 @@
|
||||
const s=/\.(zip|7z|rar|tar|gz|bz2|xz|dmg|pkg|exe|msi|iso|torrent|pdf|mp4|mkv|mp3|flac|apk|deb|rpm|ipa|img|bin)(?:$|[?#])/i,p=/^(text\/html|text\/plain|application\/json|application\/javascript|application\/xml|text\/xml)/i,d=/(^|\/)(download|downloads|dl|get|file|files|attachment|attachments)(\/|$)/i;function i(n,t){try{return new URL(n,t)}catch{return null}}function w(n,t){const e=i(n,t);return e?e.toString():String(n||"")}function a(n,t){const e=i(n,t);return e?s.test(e.pathname||""):s.test(String(n||""))}function g(n){const t=String(n||"").replace(/-/g,"+").replace(/_/g,"/");try{return atob(t)}catch{return""}}function m(n){if(!d.test(n))return!1;const t=String(n||"").split("/").filter(Boolean),e=t[t.length-1]||"";return!e||e.includes(".")?!1:/^[a-z0-9_-]{12,}$/i.test(e)}function h(n){const t=n.searchParams,e=t.get("golink");if(e){const r=g(e);if(r&&s.test(r))return!0}const o=t.get("filename")||t.get("file")||t.get("name")||t.get("out");return!!(o&&s.test(o)||t.has("attachment")||t.has("download"))}function y(n,t){const e=i(n,t);return!e||!["http:","https:","ftp:"].includes(e.protocol)?!1:!!(a(e.toString())||h(e)||m(e.pathname||""))}function L(n){const t=Array.isArray(n?.responseHeaders)?n.responseHeaders:[],e=l=>{const c=String(l||"").toLowerCase(),u=t.find(f=>String(f?.name||"").toLowerCase()===c);return String(u?.value||"")},o=e("content-disposition").toLowerCase(),r=e("content-type").toLowerCase();return o.includes("attachment")||a(n.url||"")?!0:!r||p.test(r)?!1:r.startsWith("application/")||r.startsWith("audio/")||r.startsWith("video/")}export{L as a,y as i,w as n};
|
||||
1
packages/chrome/assets/index-B2D5FcJM.css
Normal file
@@ -0,0 +1 @@
|
||||
:root{color-scheme:dark;font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}body{margin:0;background:#141820;color:#e6ebf7}.wrap{max-width:860px;margin:0 auto;padding:24px;display:grid;gap:12px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.card{background:#1f2530;border:1px solid #323b4a;border-radius:10px;padding:12px;display:grid;gap:8px}label{font-size:12px;color:#aeb8cc}input,textarea{border:1px solid #3c4658;border-radius:7px;background:#121721;color:#e6ebf7;padding:8px 10px}input[type=checkbox]{width:16px;height:16px}.row{display:flex;align-items:center;justify-content:space-between;gap:8px}.actions{display:flex;gap:8px}button{border:1px solid #5967f4;background:#5967f4;color:#fff;border-radius:8px;padding:8px 12px;font-weight:600;cursor:pointer}button.ghost{background:#232a36;border-color:#3b4658}@media(max-width:900px){.grid{grid-template-columns:1fr}}
|
||||
1
packages/chrome/assets/index-D6aWDpYY.css
Normal file
@@ -0,0 +1 @@
|
||||
:root{color-scheme:dark;font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}body{margin:0;background:#151821;color:#e7ebf7;width:360px}.container{padding:14px;display:grid;gap:10px}h1{margin:0;font-size:14px}.field{display:grid;gap:6px}label{font-size:12px;color:#aeb6cc}input[type=text],input[type=number]{height:32px;border:1px solid #3e4658;border-radius:6px;padding:0 10px;background:#202532;color:#e7ebf7}.toggle{display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#cdd5ea}button{height:34px;border:1px solid #5562f0;border-radius:8px;background:#5562f0;color:#fff;font-weight:600;cursor:pointer}.media-panel{margin-top:6px;border:1px solid #384255;border-radius:8px;padding:8px;background:#1b202c;display:grid;gap:8px}.media-head{display:flex;align-items:center;justify-content:space-between;font-size:12px}.media-list{display:grid;gap:6px;max-height:150px;overflow:auto}.media-item{display:flex;align-items:center;justify-content:space-between;gap:8px}.media-meta{min-width:0;display:grid;gap:2px}.kind{font-size:11px;color:#8fc0ff}.url{font-size:11px;color:#c6d1e8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:250px}.mini{height:26px;min-width:44px;padding:0 8px;border-radius:6px;font-size:11px}.mini.ghost{background:#2a3140;border-color:#47546c;color:#d4def2}.empty{font-size:11px;color:#96a3bc}.status{font-size:12px;color:#8fe0a6;min-height:14px}
|
||||
3
packages/chrome/assets/index.html-B0Kfv8fq.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import{c as p,j as e,R as a}from"./client-CBvt1tWS.js";import{g as j,s as m}from"./settings-Bo6W9Drl.js";import"./browser-polyfill-CZ_dLIqp.js";function u(){const[t,i]=a.useState(null),[l,r]=a.useState(""),[h,d]=a.useState("");a.useEffect(()=>{j().then(s=>{i(s),r((s.blacklist||[]).join(`
|
||||
`))})},[]);const n=(s,c)=>{i(o=>o&&{...o,[s]:c})},x=async()=>{if(!t)return;const s={...t,minFileSize:Number(t.minFileSize||0),motrixPort:Number(t.motrixPort||16800),blacklist:l.split(`
|
||||
`).map(c=>c.trim()).filter(Boolean)};await m(s),i(s),d("Saved"),window.setTimeout(()=>d(""),1500)};return t?e.jsxs("div",{className:"wrap",children:[e.jsx("h1",{children:"Gomdown Helper Settings"}),e.jsxs("div",{className:"grid",children:[e.jsxs("section",{className:"card",children:[e.jsx("label",{children:"RPC Secret"}),e.jsx("input",{value:t.motrixAPIkey,onChange:s=>n("motrixAPIkey",s.target.value)}),e.jsx("label",{children:"RPC Port"}),e.jsx("input",{type:"number",value:t.motrixPort,onChange:s=>n("motrixPort",Number(s.target.value||16800))}),e.jsx("label",{children:"Min file size (MB)"}),e.jsx("input",{type:"number",value:t.minFileSize,onChange:s=>n("minFileSize",Number(s.target.value||0))}),e.jsx("label",{children:"Blacklist (one per line)"}),e.jsx("textarea",{rows:8,value:l,onChange:s=>r(s.target.value)})]}),e.jsxs("section",{className:"card",children:[e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Extension enabled"}),e.jsx("input",{type:"checkbox",checked:t.extensionStatus,onChange:s=>n("extensionStatus",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Enable notifications"}),e.jsx("input",{type:"checkbox",checked:t.enableNotifications,onChange:s=>n("enableNotifications",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Use native host"}),e.jsx("input",{type:"checkbox",checked:t.useNativeHost,onChange:s=>n("useNativeHost",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Activate app on download"}),e.jsx("input",{type:"checkbox",checked:t.activateAppOnDownload,onChange:s=>n("activateAppOnDownload",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Hide browser download shelf"}),e.jsx("input",{type:"checkbox",checked:t.hideChromeBar,onChange:s=>n("hideChromeBar",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Show context menu option"}),e.jsx("input",{type:"checkbox",checked:t.showContextOption,onChange:s=>n("showContextOption",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Download fallback"}),e.jsx("input",{type:"checkbox",checked:t.downloadFallback,onChange:s=>n("downloadFallback",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Dark mode"}),e.jsx("input",{type:"checkbox",checked:t.darkMode,onChange:s=>n("darkMode",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Show only aria downloads"}),e.jsx("input",{type:"checkbox",checked:t.showOnlyAria,onChange:s=>n("showOnlyAria",s.target.checked)})]})]})]}),e.jsxs("div",{className:"actions",children:[e.jsx("button",{onClick:x,children:"Save"}),e.jsx("button",{className:"ghost",onClick:()=>window.close(),children:"Close"})]}),e.jsx("div",{children:h})]}):e.jsx("div",{className:"wrap",children:"Loading..."})}p.createRoot(document.getElementById("root")).render(e.jsx(a.StrictMode,{children:e.jsx(u,{})}));
|
||||
1
packages/chrome/assets/index.html-Tb8yZAds.js
Normal file
@@ -0,0 +1 @@
|
||||
import{c as k,j as t,R as r}from"./client-CBvt1tWS.js";import{b as i}from"./browser-polyfill-CZ_dLIqp.js";import{g as N,s as m}from"./settings-Bo6W9Drl.js";function b(){const[s,d]=r.useState(null),[x,n]=r.useState(""),[l,u]=r.useState([]);r.useEffect(()=>{N().then(d)},[]),r.useEffect(()=>{let e=null;const a=async()=>{const o=await i.runtime.sendMessage({type:"media:list"});o?.ok&&Array.isArray(o.items)&&u(o.items.slice(0,10))};return a(),e=window.setInterval(()=>{a()},2e3),()=>{e!==null&&window.clearInterval(e)}},[]);const c=(e,a)=>{d(o=>o&&{...o,[e]:a})},h=async e=>{if(!s)return;const a={...s,extensionStatus:e};d(a),await m({extensionStatus:e}),n(e?"Extension ON":"Extension OFF"),window.setTimeout(()=>n(""),1200)},p=async()=>{s&&(await m(s),n("Saved"),window.setTimeout(()=>n(""),1200))},g=async()=>{const e=i.runtime.getURL("src/config/index.html");await i.tabs.create({url:e})},j=async()=>{const e=i.runtime.getURL("src/history/index.html");await i.tabs.create({url:e})},v=async()=>{const e=await i.runtime.sendMessage({type:"page:enqueue-ytdlp"});n(e?.ok?"Active tab sent to gdown (yt-dlp)":`Send failed: ${e?.error||"unknown error"}`),window.setTimeout(()=>n(""),1800)},w=async e=>{const a=await i.runtime.sendMessage({type:"media:enqueue",url:e.url,referer:e.referer||""});n(a?.ok?"Media sent to gdown":`Send failed: ${a?.error||"unknown error"}`),window.setTimeout(()=>n(""),1600)},y=async()=>{await i.runtime.sendMessage({type:"media:clear"}),u([]),n("Captured media cleared"),window.setTimeout(()=>n(""),1200)};return s?t.jsxs("div",{className:"container",children:[t.jsx("h1",{children:"Gomdown Helper"}),t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"RPC Secret"}),t.jsx("input",{type:"text",value:s.motrixAPIkey,onChange:e=>c("motrixAPIkey",e.target.value),placeholder:"aria2 rpc secret"})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"RPC Port"}),t.jsx("input",{type:"number",value:s.motrixPort,onChange:e=>c("motrixPort",Number(e.target.value||16800))})]}),t.jsxs("label",{className:"toggle",children:["Extension Enabled",t.jsx("input",{type:"checkbox",checked:s.extensionStatus,onChange:e=>{h(e.target.checked)}})]}),t.jsxs("label",{className:"toggle",children:["Use Native Host",t.jsx("input",{type:"checkbox",checked:s.useNativeHost,onChange:e=>c("useNativeHost",e.target.checked)})]}),t.jsxs("label",{className:"toggle",children:["Activate gdown App",t.jsx("input",{type:"checkbox",checked:s.activateAppOnDownload,onChange:e=>c("activateAppOnDownload",e.target.checked)})]}),t.jsx("button",{onClick:p,children:"Save"}),t.jsx("button",{onClick:g,children:"Settings"}),t.jsx("button",{onClick:j,children:"History"}),t.jsx("button",{onClick:()=>{v()},children:"Send Active Tab (yt-dlp)"}),t.jsxs("div",{className:"media-panel",children:[t.jsxs("div",{className:"media-head",children:[t.jsx("strong",{children:"Captured Media"}),t.jsx("button",{className:"mini ghost",onClick:y,children:"Clear"})]}),l.length===0?t.jsx("div",{className:"empty",children:"No media captured yet"}):t.jsx("div",{className:"media-list",children:l.map(e=>t.jsxs("div",{className:"media-item",children:[t.jsxs("div",{className:"media-meta",children:[t.jsx("span",{className:"kind",children:e.kind.toUpperCase()}),t.jsx("span",{className:"url",children:e.url})]}),t.jsx("button",{className:"mini",onClick:()=>{w(e)},children:"Add"})]},e.id))})]}),t.jsx("div",{className:"status",children:x})]}):t.jsx("div",{className:"container",children:"Loading..."})}k.createRoot(document.getElementById("root")).render(t.jsx(r.StrictMode,{children:t.jsx(b,{})}));
|
||||
1
packages/chrome/assets/index.ts-BGLNJwsP.js
Normal file
@@ -0,0 +1 @@
|
||||
import{b as w}from"./browser-polyfill-CZ_dLIqp.js";import{i as o,n as h}from"./downloadIntent-Dv31jC2S.js";const p=8e3,e=new Map;function m(){const r=Date.now();for(const[n,t]of e.entries())t<=r&&e.delete(n)}async function i(r,n){const t=h(r,window.location.href);if(!t)return!1;if(m(),e.has(t))return!0;e.set(t,Date.now()+p);try{if((await w.runtime.sendMessage({type:"capture-link-download",url:t,referer:n||document.referrer||window.location.href}))?.ok)return!0}catch{}return e.delete(t),!1}function u(r){return r?r instanceof HTMLAnchorElement?r:r instanceof Element?r.closest("a[href]"):null:null}function a(r){return!!(r.metaKey||r.ctrlKey||r.shiftKey||r.altKey)}async function d(r){if(r.defaultPrevented||a(r))return;const n=u(r.target);if(!n)return;const t=n.href||"";!t||!o(t,window.location.href)||(r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation(),await i(t,document.referrer||window.location.href))}function l(r){const n=u(r.target);if(!n)return;const t=n.href||"";!t||!o(t,window.location.href)||a(r)||(r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation(),i(t,document.referrer||window.location.href))}document.addEventListener("pointerdown",r=>{r.button===0&&l(r)},!0);document.addEventListener("mousedown",r=>{r.button===0&&l(r)},!0);document.addEventListener("click",r=>{r.button===0&&d(r)},!0);document.addEventListener("keydown",r=>{if(r.key!=="Enter"||r.defaultPrevented||a(r))return;const n=u(r.target);if(!n)return;const t=n.href||"";!t||!o(t,window.location.href)||(r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation(),i(t,document.referrer||window.location.href))},!0);document.addEventListener("auxclick",r=>{r.button===1&&d(r)},!0);function g(){try{const r=window.open.bind(window);window.open=function(t,f,s){const c=String(t||"").trim();return c&&o(c,window.location.href)?(i(c,window.location.href),null):r(t,f,s)}}catch{}try{const r=HTMLAnchorElement.prototype.click;HTMLAnchorElement.prototype.click=function(){const t=this.href||this.getAttribute("href")||"";if(t&&o(t,window.location.href)){i(t,document.referrer||window.location.href);return}r.call(this)}}catch{}}g();
|
||||
1
packages/chrome/assets/index.ts-U2ACoZ75.js
Normal file
13
packages/chrome/assets/index.ts-loader-DMyyuf2n.js
Normal file
@@ -0,0 +1,13 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
const injectTime = performance.now();
|
||||
(async () => {
|
||||
const { onExecute } = await import(
|
||||
/* @vite-ignore */
|
||||
chrome.runtime.getURL("assets/index.ts-BGLNJwsP.js")
|
||||
);
|
||||
onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } });
|
||||
})().catch(console.error);
|
||||
|
||||
})();
|
||||
1
packages/chrome/assets/settings-Bo6W9Drl.js
Normal file
@@ -0,0 +1 @@
|
||||
import{b as e}from"./browser-polyfill-CZ_dLIqp.js";const t={extensionStatus:!0,useNativeHost:!0,activateAppOnDownload:!0,enableNotifications:!0,hideChromeBar:!0,showContextOption:!0,downloadFallback:!1,darkMode:!1,showOnlyAria:!1,minFileSize:0,blacklist:[],motrixPort:16800,motrixAPIkey:""};async function n(){const o=await e.storage.sync.get(Object.keys(t));return{extensionStatus:!!(o.extensionStatus??t.extensionStatus),useNativeHost:!!(o.useNativeHost??t.useNativeHost),activateAppOnDownload:!!(o.activateAppOnDownload??t.activateAppOnDownload),enableNotifications:!!(o.enableNotifications??t.enableNotifications),hideChromeBar:!!(o.hideChromeBar??t.hideChromeBar),showContextOption:!!(o.showContextOption??t.showContextOption),downloadFallback:!!(o.downloadFallback??t.downloadFallback),darkMode:!!(o.darkMode??t.darkMode),showOnlyAria:!!(o.showOnlyAria??t.showOnlyAria),minFileSize:Number(o.minFileSize??t.minFileSize),blacklist:Array.isArray(o.blacklist)?o.blacklist.map(a=>String(a)):t.blacklist,motrixPort:Number(o.motrixPort??t.motrixPort),motrixAPIkey:String(o.motrixAPIkey??t.motrixAPIkey)}}async function s(o){await e.storage.sync.set(o)}export{n as g,s};
|
||||
BIN
packages/chrome/images/128.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
packages/chrome/images/16.png
Normal file
|
After Width: | Height: | Size: 597 B |
BIN
packages/chrome/images/32.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
packages/chrome/images/48.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
packages/chrome/images/dwld.png
Normal file
|
After Width: | Height: | Size: 553 B |
BIN
packages/chrome/images/icon-large.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
68
packages/chrome/manifest.json
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "Gomdown Helper",
|
||||
"description": "Send browser downloads to gdown",
|
||||
"version": "0.0.10",
|
||||
"default_locale": "en",
|
||||
"icons": {
|
||||
"16": "images/16.png",
|
||||
"32": "images/32.png",
|
||||
"48": "images/48.png",
|
||||
"128": "images/128.png"
|
||||
},
|
||||
"background": {
|
||||
"service_worker": "service-worker-loader.js",
|
||||
"type": "module"
|
||||
},
|
||||
"action": {
|
||||
"default_popup": "src/popup/index.html",
|
||||
"default_title": "Gomdown Helper",
|
||||
"default_icon": {
|
||||
"16": "images/16.png",
|
||||
"32": "images/32.png",
|
||||
"48": "images/48.png",
|
||||
"128": "images/128.png"
|
||||
}
|
||||
},
|
||||
"options_page": "src/config/index.html",
|
||||
"content_scripts": [
|
||||
{
|
||||
"js": [
|
||||
"assets/index.ts-loader-DMyyuf2n.js"
|
||||
],
|
||||
"matches": [
|
||||
"<all_urls>"
|
||||
],
|
||||
"run_at": "document_start",
|
||||
"all_frames": true
|
||||
}
|
||||
],
|
||||
"permissions": [
|
||||
"downloads",
|
||||
"downloads.shelf",
|
||||
"notifications",
|
||||
"storage",
|
||||
"contextMenus",
|
||||
"cookies",
|
||||
"webRequest",
|
||||
"nativeMessaging"
|
||||
],
|
||||
"host_permissions": [
|
||||
"<all_urls>"
|
||||
],
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"matches": [
|
||||
"<all_urls>"
|
||||
],
|
||||
"resources": [
|
||||
"images/*",
|
||||
"assets/browser-polyfill-CZ_dLIqp.js",
|
||||
"assets/downloadIntent-Dv31jC2S.js",
|
||||
"assets/index.ts-BGLNJwsP.js"
|
||||
],
|
||||
"use_dynamic_url": false
|
||||
}
|
||||
],
|
||||
"short_name": "Gomdown"
|
||||
}
|
||||
1
packages/chrome/service-worker-loader.js
Normal file
@@ -0,0 +1 @@
|
||||
import './assets/index.ts-U2ACoZ75.js';
|
||||
16
packages/chrome/src/config/index.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Gomdown Helper Settings</title>
|
||||
<script type="module" crossorigin src="/assets/index.html-B0Kfv8fq.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/browser-polyfill-CZ_dLIqp.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/client-CBvt1tWS.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/settings-Bo6W9Drl.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-B2D5FcJM.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
16
packages/chrome/src/popup/index.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Gomdown Helper</title>
|
||||
<script type="module" crossorigin src="/assets/index.html-Tb8yZAds.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/browser-polyfill-CZ_dLIqp.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/client-CBvt1tWS.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/settings-Bo6W9Drl.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-D6aWDpYY.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
83
packages/edge/.vite/manifest.json
Normal file
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"../../../../../@crx/manifest": {
|
||||
"file": "assets/crx-manifest.js-DthtiGNU.js",
|
||||
"name": "crx-manifest.js",
|
||||
"src": "../../../../../@crx/manifest",
|
||||
"isEntry": true
|
||||
},
|
||||
"_browser-polyfill-CZ_dLIqp.js": {
|
||||
"file": "assets/browser-polyfill-CZ_dLIqp.js",
|
||||
"name": "browser-polyfill"
|
||||
},
|
||||
"_client-CBvt1tWS.js": {
|
||||
"file": "assets/client-CBvt1tWS.js",
|
||||
"name": "client",
|
||||
"imports": [
|
||||
"_browser-polyfill-CZ_dLIqp.js"
|
||||
]
|
||||
},
|
||||
"_downloadIntent-Dv31jC2S.js": {
|
||||
"file": "assets/downloadIntent-Dv31jC2S.js",
|
||||
"name": "downloadIntent"
|
||||
},
|
||||
"_index.ts-loader-DMyyuf2n.js": {
|
||||
"file": "assets/index.ts-loader-DMyyuf2n.js",
|
||||
"src": "_index.ts-loader-DMyyuf2n.js"
|
||||
},
|
||||
"_settings-Bo6W9Drl.js": {
|
||||
"file": "assets/settings-Bo6W9Drl.js",
|
||||
"name": "settings",
|
||||
"imports": [
|
||||
"_browser-polyfill-CZ_dLIqp.js"
|
||||
]
|
||||
},
|
||||
"src/background/index.ts": {
|
||||
"file": "assets/index.ts-BnPsJZXz.js",
|
||||
"name": "index.ts",
|
||||
"src": "src/background/index.ts",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_browser-polyfill-CZ_dLIqp.js",
|
||||
"_downloadIntent-Dv31jC2S.js",
|
||||
"_settings-Bo6W9Drl.js"
|
||||
]
|
||||
},
|
||||
"src/config/index.html": {
|
||||
"file": "assets/index.html-B0Kfv8fq.js",
|
||||
"name": "index.html",
|
||||
"src": "src/config/index.html",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_client-CBvt1tWS.js",
|
||||
"_settings-Bo6W9Drl.js",
|
||||
"_browser-polyfill-CZ_dLIqp.js"
|
||||
],
|
||||
"css": [
|
||||
"assets/index-B2D5FcJM.css"
|
||||
]
|
||||
},
|
||||
"src/content/index.ts": {
|
||||
"file": "assets/index.ts-BGLNJwsP.js",
|
||||
"name": "index.ts",
|
||||
"src": "src/content/index.ts",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_browser-polyfill-CZ_dLIqp.js",
|
||||
"_downloadIntent-Dv31jC2S.js"
|
||||
]
|
||||
},
|
||||
"src/popup/index.html": {
|
||||
"file": "assets/index.html-D-JbSuV5.js",
|
||||
"name": "index.html",
|
||||
"src": "src/popup/index.html",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_client-CBvt1tWS.js",
|
||||
"_browser-polyfill-CZ_dLIqp.js",
|
||||
"_settings-Bo6W9Drl.js"
|
||||
],
|
||||
"css": [
|
||||
"assets/index-BZvbrf4l.css"
|
||||
]
|
||||
}
|
||||
}
|
||||
86
packages/edge/_locales/en/messages.json
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"appName": {
|
||||
"message": "Motrix WebExtension",
|
||||
"description": "The name of the application"
|
||||
},
|
||||
"appShortName": {
|
||||
"message": "Motrix WebExt",
|
||||
"description": "The short_name (maximum of 12 characters recommended) is a short version of the app's name."
|
||||
},
|
||||
"appDescription": {
|
||||
"message": "WebExtension for Motrix download manager",
|
||||
"description": "The description of the application"
|
||||
},
|
||||
"browserActionTitle": {
|
||||
"message": "Motrix WebExtension",
|
||||
"description": "The title of the browser action button"
|
||||
},
|
||||
"extensionStatus": {
|
||||
"message": "Extension status:",
|
||||
"description": "Extension status"
|
||||
},
|
||||
"enableNotifications": {
|
||||
"message": "Enable notifications:",
|
||||
"description": "Enable Notifications"
|
||||
},
|
||||
"setKey": {
|
||||
"message": "Set Key",
|
||||
"description": "Set Key"
|
||||
},
|
||||
"setMinSize": {
|
||||
"message": "Set minimum file size (mb)",
|
||||
"description": "Set minimum file size"
|
||||
},
|
||||
"setSize": {
|
||||
"message": "Set size",
|
||||
"description": "Set size"
|
||||
},
|
||||
"keyInputPlaceholder": {
|
||||
"message": "Motrix API Key",
|
||||
"description": "Motrix API Key"
|
||||
},
|
||||
"blacklist": {
|
||||
"message": "Blacklist",
|
||||
"description": "Blacklist"
|
||||
},
|
||||
"saveBlacklist": {
|
||||
"message": "Save blacklist",
|
||||
"description": "Save blacklist"
|
||||
},
|
||||
"darkMode": {
|
||||
"message": "Dark mode",
|
||||
"description": "Dark mode"
|
||||
},
|
||||
"showOnlyAria": {
|
||||
"message": "Show only Motrix downloads in the popup",
|
||||
"description": "Show only Motrix downloads in the popup"
|
||||
},
|
||||
"hideChromeBar": {
|
||||
"message": "Hide chrome download bar",
|
||||
"description": "Hide chrome download bar"
|
||||
},
|
||||
"showContextOption": {
|
||||
"message": "Show \"Download with gdown\" context option",
|
||||
"description": "Show \"Download with gdown\" context option"
|
||||
},
|
||||
"downloadWithMotrix": {
|
||||
"message": "Download with gdown",
|
||||
"description": "Download with gdown"
|
||||
},
|
||||
"setPort": {
|
||||
"message": "Set Port",
|
||||
"description": "Set Port"
|
||||
},
|
||||
"downloadFallback": {
|
||||
"message": "If launching in gdown fails, use the browser's default download manager",
|
||||
"description": "If launching in gdown fails, use the browser's default download manager"
|
||||
},
|
||||
"useNativeHost": {
|
||||
"message": "Use Native Messaging host for downloads",
|
||||
"description": "Use Native Messaging host for downloads"
|
||||
},
|
||||
"activateAppOnDownload": {
|
||||
"message": "Activate gdown app when transfer starts",
|
||||
"description": "Activate gdown app when transfer starts"
|
||||
}
|
||||
}
|
||||
86
packages/edge/_locales/zh/messages.json
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"appName": {
|
||||
"message": "Motrix 网页扩展",
|
||||
"description": "应用程序名称"
|
||||
},
|
||||
"appShortName": {
|
||||
"message": "Motrix 扩展",
|
||||
"description": "应用程序缩略名称"
|
||||
},
|
||||
"appDescription": {
|
||||
"message": "用于 Motrix 下载管理器的网页扩展",
|
||||
"description": "应用程序描述"
|
||||
},
|
||||
"browserActionTitle": {
|
||||
"message": "Motrix 网页扩展",
|
||||
"description": "浏览器操作按钮标题"
|
||||
},
|
||||
"extensionStatus": {
|
||||
"message": "扩展状态",
|
||||
"description": "扩展状态"
|
||||
},
|
||||
"enableNotifications": {
|
||||
"message": "允许桌面通知",
|
||||
"description": "允许桌面通知"
|
||||
},
|
||||
"setKey": {
|
||||
"message": "设置密钥",
|
||||
"description": "设置密钥"
|
||||
},
|
||||
"setMinSize": {
|
||||
"message": "设置最小下载文件 (mb)",
|
||||
"description": "设置最小下载文件"
|
||||
},
|
||||
"setSize": {
|
||||
"message": "设置大小",
|
||||
"description": "设置大小"
|
||||
},
|
||||
"keyInputPlaceholder": {
|
||||
"message": "Motrix API 密钥",
|
||||
"description": "Motrix API 密钥"
|
||||
},
|
||||
"blacklist": {
|
||||
"message": "黑名单",
|
||||
"description": "黑名单"
|
||||
},
|
||||
"saveBlacklist": {
|
||||
"message": "保存黑名单",
|
||||
"description": "保存黑名单"
|
||||
},
|
||||
"darkMode": {
|
||||
"message": "深色模式",
|
||||
"description": "深色模式"
|
||||
},
|
||||
"showOnlyAria": {
|
||||
"message": "在弹出窗口中仅显示 Motrix 下载",
|
||||
"description": "在弹出窗口中仅显示 Motrix 下载"
|
||||
},
|
||||
"hideChromeBar": {
|
||||
"message": "隐藏 Chrome 下载栏",
|
||||
"description": "隐藏 Chrome 下载栏"
|
||||
},
|
||||
"showContextOption": {
|
||||
"message": "显示“使用 gdown 下载”右键选项",
|
||||
"description": "显示“使用 gdown 下载”右键选项"
|
||||
},
|
||||
"downloadWithMotrix": {
|
||||
"message": "使用 gdown 下载",
|
||||
"description": "使用 gdown 下载"
|
||||
},
|
||||
"setPort": {
|
||||
"message": "设置端口",
|
||||
"description": "设置端口"
|
||||
},
|
||||
"downloadFallback": {
|
||||
"message": "如果 gdown 启动失败,则使用浏览器的默认下载管理器",
|
||||
"description": "如果 gdown 启动失败,则使用浏览器的默认下载管理器"
|
||||
},
|
||||
"useNativeHost": {
|
||||
"message": "使用 Native Messaging 主机传输下载",
|
||||
"description": "使用 Native Messaging 主机传输下载"
|
||||
},
|
||||
"activateAppOnDownload": {
|
||||
"message": "下载转交时激活 gdown 应用",
|
||||
"description": "下载转交时激活 gdown 应用"
|
||||
}
|
||||
}
|
||||
1
packages/edge/assets/browser-polyfill-CZ_dLIqp.js
Normal file
8
packages/edge/assets/client-CBvt1tWS.js
Normal file
1
packages/edge/assets/downloadIntent-Dv31jC2S.js
Normal file
@@ -0,0 +1 @@
|
||||
const s=/\.(zip|7z|rar|tar|gz|bz2|xz|dmg|pkg|exe|msi|iso|torrent|pdf|mp4|mkv|mp3|flac|apk|deb|rpm|ipa|img|bin)(?:$|[?#])/i,p=/^(text\/html|text\/plain|application\/json|application\/javascript|application\/xml|text\/xml)/i,d=/(^|\/)(download|downloads|dl|get|file|files|attachment|attachments)(\/|$)/i;function i(n,t){try{return new URL(n,t)}catch{return null}}function w(n,t){const e=i(n,t);return e?e.toString():String(n||"")}function a(n,t){const e=i(n,t);return e?s.test(e.pathname||""):s.test(String(n||""))}function g(n){const t=String(n||"").replace(/-/g,"+").replace(/_/g,"/");try{return atob(t)}catch{return""}}function m(n){if(!d.test(n))return!1;const t=String(n||"").split("/").filter(Boolean),e=t[t.length-1]||"";return!e||e.includes(".")?!1:/^[a-z0-9_-]{12,}$/i.test(e)}function h(n){const t=n.searchParams,e=t.get("golink");if(e){const r=g(e);if(r&&s.test(r))return!0}const o=t.get("filename")||t.get("file")||t.get("name")||t.get("out");return!!(o&&s.test(o)||t.has("attachment")||t.has("download"))}function y(n,t){const e=i(n,t);return!e||!["http:","https:","ftp:"].includes(e.protocol)?!1:!!(a(e.toString())||h(e)||m(e.pathname||""))}function L(n){const t=Array.isArray(n?.responseHeaders)?n.responseHeaders:[],e=l=>{const c=String(l||"").toLowerCase(),u=t.find(f=>String(f?.name||"").toLowerCase()===c);return String(u?.value||"")},o=e("content-disposition").toLowerCase(),r=e("content-type").toLowerCase();return o.includes("attachment")||a(n.url||"")?!0:!r||p.test(r)?!1:r.startsWith("application/")||r.startsWith("audio/")||r.startsWith("video/")}export{L as a,y as i,w as n};
|
||||
1
packages/edge/assets/index-B2D5FcJM.css
Normal file
@@ -0,0 +1 @@
|
||||
:root{color-scheme:dark;font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}body{margin:0;background:#141820;color:#e6ebf7}.wrap{max-width:860px;margin:0 auto;padding:24px;display:grid;gap:12px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.card{background:#1f2530;border:1px solid #323b4a;border-radius:10px;padding:12px;display:grid;gap:8px}label{font-size:12px;color:#aeb8cc}input,textarea{border:1px solid #3c4658;border-radius:7px;background:#121721;color:#e6ebf7;padding:8px 10px}input[type=checkbox]{width:16px;height:16px}.row{display:flex;align-items:center;justify-content:space-between;gap:8px}.actions{display:flex;gap:8px}button{border:1px solid #5967f4;background:#5967f4;color:#fff;border-radius:8px;padding:8px 12px;font-weight:600;cursor:pointer}button.ghost{background:#232a36;border-color:#3b4658}@media(max-width:900px){.grid{grid-template-columns:1fr}}
|
||||
1
packages/edge/assets/index-BZvbrf4l.css
Normal file
@@ -0,0 +1 @@
|
||||
:root{color-scheme:dark;font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}body{margin:0;background:#151821;color:#e7ebf7;width:360px}.container{padding:14px;display:grid;gap:10px}h1{margin:0;font-size:14px}.field{display:grid;gap:6px}label{font-size:12px;color:#aeb6cc}input[type=text],input[type=number]{height:32px;border:1px solid #3e4658;border-radius:6px;padding:0 10px;background:#202532;color:#e7ebf7}.toggle{display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#cdd5ea}button{height:34px;border:1px solid #5562f0;border-radius:8px;background:#5562f0;color:#fff;font-weight:600;cursor:pointer}.status{font-size:12px;color:#8fe0a6;min-height:14px}
|
||||
3
packages/edge/assets/index.html-B0Kfv8fq.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import{c as p,j as e,R as a}from"./client-CBvt1tWS.js";import{g as j,s as m}from"./settings-Bo6W9Drl.js";import"./browser-polyfill-CZ_dLIqp.js";function u(){const[t,i]=a.useState(null),[l,r]=a.useState(""),[h,d]=a.useState("");a.useEffect(()=>{j().then(s=>{i(s),r((s.blacklist||[]).join(`
|
||||
`))})},[]);const n=(s,c)=>{i(o=>o&&{...o,[s]:c})},x=async()=>{if(!t)return;const s={...t,minFileSize:Number(t.minFileSize||0),motrixPort:Number(t.motrixPort||16800),blacklist:l.split(`
|
||||
`).map(c=>c.trim()).filter(Boolean)};await m(s),i(s),d("Saved"),window.setTimeout(()=>d(""),1500)};return t?e.jsxs("div",{className:"wrap",children:[e.jsx("h1",{children:"Gomdown Helper Settings"}),e.jsxs("div",{className:"grid",children:[e.jsxs("section",{className:"card",children:[e.jsx("label",{children:"RPC Secret"}),e.jsx("input",{value:t.motrixAPIkey,onChange:s=>n("motrixAPIkey",s.target.value)}),e.jsx("label",{children:"RPC Port"}),e.jsx("input",{type:"number",value:t.motrixPort,onChange:s=>n("motrixPort",Number(s.target.value||16800))}),e.jsx("label",{children:"Min file size (MB)"}),e.jsx("input",{type:"number",value:t.minFileSize,onChange:s=>n("minFileSize",Number(s.target.value||0))}),e.jsx("label",{children:"Blacklist (one per line)"}),e.jsx("textarea",{rows:8,value:l,onChange:s=>r(s.target.value)})]}),e.jsxs("section",{className:"card",children:[e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Extension enabled"}),e.jsx("input",{type:"checkbox",checked:t.extensionStatus,onChange:s=>n("extensionStatus",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Enable notifications"}),e.jsx("input",{type:"checkbox",checked:t.enableNotifications,onChange:s=>n("enableNotifications",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Use native host"}),e.jsx("input",{type:"checkbox",checked:t.useNativeHost,onChange:s=>n("useNativeHost",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Activate app on download"}),e.jsx("input",{type:"checkbox",checked:t.activateAppOnDownload,onChange:s=>n("activateAppOnDownload",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Hide browser download shelf"}),e.jsx("input",{type:"checkbox",checked:t.hideChromeBar,onChange:s=>n("hideChromeBar",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Show context menu option"}),e.jsx("input",{type:"checkbox",checked:t.showContextOption,onChange:s=>n("showContextOption",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Download fallback"}),e.jsx("input",{type:"checkbox",checked:t.downloadFallback,onChange:s=>n("downloadFallback",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Dark mode"}),e.jsx("input",{type:"checkbox",checked:t.darkMode,onChange:s=>n("darkMode",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Show only aria downloads"}),e.jsx("input",{type:"checkbox",checked:t.showOnlyAria,onChange:s=>n("showOnlyAria",s.target.checked)})]})]})]}),e.jsxs("div",{className:"actions",children:[e.jsx("button",{onClick:x,children:"Save"}),e.jsx("button",{className:"ghost",onClick:()=>window.close(),children:"Close"})]}),e.jsx("div",{children:h})]}):e.jsx("div",{className:"wrap",children:"Loading..."})}p.createRoot(document.getElementById("root")).render(e.jsx(a.StrictMode,{children:e.jsx(u,{})}));
|
||||
1
packages/edge/assets/index.html-D-JbSuV5.js
Normal file
@@ -0,0 +1 @@
|
||||
import{c as g,j as e,R as c}from"./client-CBvt1tWS.js";import{b as a}from"./browser-polyfill-CZ_dLIqp.js";import{g as m,s as p}from"./settings-Bo6W9Drl.js";function j(){const[s,o]=c.useState(null),[l,r]=c.useState("");c.useEffect(()=>{m().then(o)},[]);const n=(t,h)=>{o(i=>i&&{...i,[t]:h})},d=async()=>{s&&(await p(s),r("Saved"),window.setTimeout(()=>r(""),1200))},u=async()=>{const t=a.runtime.getURL("src/config/index.html");await a.tabs.create({url:t})},x=async()=>{const t=a.runtime.getURL("src/history/index.html");await a.tabs.create({url:t})};return s?e.jsxs("div",{className:"container",children:[e.jsx("h1",{children:"Gomdown Helper"}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:"RPC Secret"}),e.jsx("input",{type:"text",value:s.motrixAPIkey,onChange:t=>n("motrixAPIkey",t.target.value),placeholder:"aria2 rpc secret"})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:"RPC Port"}),e.jsx("input",{type:"number",value:s.motrixPort,onChange:t=>n("motrixPort",Number(t.target.value||16800))})]}),e.jsxs("label",{className:"toggle",children:["Extension Enabled",e.jsx("input",{type:"checkbox",checked:s.extensionStatus,onChange:t=>n("extensionStatus",t.target.checked)})]}),e.jsxs("label",{className:"toggle",children:["Use Native Host",e.jsx("input",{type:"checkbox",checked:s.useNativeHost,onChange:t=>n("useNativeHost",t.target.checked)})]}),e.jsxs("label",{className:"toggle",children:["Activate gdown App",e.jsx("input",{type:"checkbox",checked:s.activateAppOnDownload,onChange:t=>n("activateAppOnDownload",t.target.checked)})]}),e.jsx("button",{onClick:d,children:"Save"}),e.jsx("button",{onClick:u,children:"Settings"}),e.jsx("button",{onClick:x,children:"History"}),e.jsx("div",{className:"status",children:l})]}):e.jsx("div",{className:"container",children:"Loading..."})}g.createRoot(document.getElementById("root")).render(e.jsx(c.StrictMode,{children:e.jsx(j,{})}));
|
||||
1
packages/edge/assets/index.ts-BGLNJwsP.js
Normal file
@@ -0,0 +1 @@
|
||||
import{b as w}from"./browser-polyfill-CZ_dLIqp.js";import{i as o,n as h}from"./downloadIntent-Dv31jC2S.js";const p=8e3,e=new Map;function m(){const r=Date.now();for(const[n,t]of e.entries())t<=r&&e.delete(n)}async function i(r,n){const t=h(r,window.location.href);if(!t)return!1;if(m(),e.has(t))return!0;e.set(t,Date.now()+p);try{if((await w.runtime.sendMessage({type:"capture-link-download",url:t,referer:n||document.referrer||window.location.href}))?.ok)return!0}catch{}return e.delete(t),!1}function u(r){return r?r instanceof HTMLAnchorElement?r:r instanceof Element?r.closest("a[href]"):null:null}function a(r){return!!(r.metaKey||r.ctrlKey||r.shiftKey||r.altKey)}async function d(r){if(r.defaultPrevented||a(r))return;const n=u(r.target);if(!n)return;const t=n.href||"";!t||!o(t,window.location.href)||(r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation(),await i(t,document.referrer||window.location.href))}function l(r){const n=u(r.target);if(!n)return;const t=n.href||"";!t||!o(t,window.location.href)||a(r)||(r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation(),i(t,document.referrer||window.location.href))}document.addEventListener("pointerdown",r=>{r.button===0&&l(r)},!0);document.addEventListener("mousedown",r=>{r.button===0&&l(r)},!0);document.addEventListener("click",r=>{r.button===0&&d(r)},!0);document.addEventListener("keydown",r=>{if(r.key!=="Enter"||r.defaultPrevented||a(r))return;const n=u(r.target);if(!n)return;const t=n.href||"";!t||!o(t,window.location.href)||(r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation(),i(t,document.referrer||window.location.href))},!0);document.addEventListener("auxclick",r=>{r.button===1&&d(r)},!0);function g(){try{const r=window.open.bind(window);window.open=function(t,f,s){const c=String(t||"").trim();return c&&o(c,window.location.href)?(i(c,window.location.href),null):r(t,f,s)}}catch{}try{const r=HTMLAnchorElement.prototype.click;HTMLAnchorElement.prototype.click=function(){const t=this.href||this.getAttribute("href")||"";if(t&&o(t,window.location.href)){i(t,document.referrer||window.location.href);return}r.call(this)}}catch{}}g();
|
||||
1
packages/edge/assets/index.ts-BnPsJZXz.js
Normal file
@@ -0,0 +1 @@
|
||||
import{b as r}from"./browser-polyfill-CZ_dLIqp.js";import{n as v,a as k}from"./downloadIntent-Dv31jC2S.js";import{g as d}from"./settings-Bo6W9Drl.js";const C="org.gdown.nativehost";async function L(e){return r.runtime.sendNativeMessage(C,{action:"addUri",...e})}async function I(){return r.runtime.sendNativeMessage(C,{action:"focus"})}const p="history";async function H(){const t=(await r.storage.local.get([p]))[p];return Array.isArray(t)?t:[]}async function M(e){await r.storage.local.set({[p]:e.slice(0,300)})}async function T(e){const t=await H(),n=t.findIndex(o=>o.gid===e.gid);n>=0?t[n]=e:t.unshift(e),await M(t)}const y=8e3,A=7e3,D="gomdown-helper-download-context-menu-option",c=new Map,w=new Map,g=new Map,m=new Map,a=new Map,h=new Map;function l(e){try{const t=new URL(e),n=(t.pathname||"/").replace(/\/+$/,"")||"/";return`${t.protocol}//${t.host}${n}`.toLowerCase()}catch{return String(e||"").toLowerCase()}}function i(e){const t=Date.now();for(const[n,o]of e.entries())o<=t&&e.delete(n)}function R(e){const t=Date.now()+y;w.set(v(e),t),g.set(l(e),t)}function q(e){!Number.isInteger(e)||(e??-1)<0||h.set(e,Date.now()+y)}function N(e){i(w),i(g);const t=v(e);return w.has(t)||g.has(l(e))}function _(e){return i(h),!Number.isInteger(e)||(e??-1)<0?!1:h.has(e)}function E(e){return i(m),m.has(l(e))}function F(e){m.set(l(e),Date.now()+A)}function O(e){return i(a),!!e&&a.has(e)}function P(e){e&&a.set(e,Date.now()+y)}async function $(){try{await I()}catch{}}async function S(e,t=""){if(E(e))return{ok:!1,error:"duplicate transfer suppressed"};const n=await d();if(!n.extensionStatus)return{ok:!1,error:"extension disabled"};if(!n.motrixAPIkey)return{ok:!1,error:"motrixAPIkey is not set"};try{const o=await L({url:e,rpcPort:n.motrixPort,rpcSecret:n.motrixAPIkey,referer:t,split:64});if(!o?.ok)return{ok:!1,error:o?.error||"native host addUri failed"};n.activateAppOnDownload&&await $(),F(e);const s=String(o?.gid||o?.requestId||`pending-${Date.now()}`),U=(()=>{try{return new URL(e).pathname}catch{return""}})().split("/").filter(Boolean).pop()||e;return await T({gid:s,downloader:"native",startTime:new Date().toISOString(),icon:"/images/32.png",name:decodeURIComponent(U),path:null,status:o?.pending?"queued":"downloading",size:0,downloaded:0}),n.enableNotifications&&await r.notifications.create(`gomdown-transfer-${Date.now()}`,{type:"basic",iconUrl:"/images/icon-large.png",title:"Gomdown Helper",message:"Download sent to gdown"}),{ok:!0}}catch(o){return{ok:!1,error:String(o)}}}async function z(e){if(e.type!=="main_frame"||(e.method||"").toUpperCase()!=="GET"||typeof e.statusCode=="number"&&(e.statusCode<200||e.statusCode>299))return!1;const t=await d();if(!t.extensionStatus||!t.motrixAPIkey)return!1;const n=String(Array.isArray(e?.responseHeaders)&&e.responseHeaders.find(s=>String(s?.name||"").toLowerCase()==="content-length")?.value||""),o=Number(n||0);return t.minFileSize>0&&o>0&&o<t.minFileSize*1024*1024?!1:k(e)}async function G(e){if(O(e.requestId)||!await z(e))return;const n=c.get(e.requestId),o=String(n?.documentUrl||n?.originUrl||n?.initiator||n?.url||"");(await S(e.url,o)).ok&&(P(e.requestId),R(e.url),q(e.tabId))}async function u(){const e=r.downloads;if(!e.setShelfEnabled)return;const t=await d();if(!t.extensionStatus)return;const n=t.useNativeHost?!1:!t.hideChromeBar;await e.setShelfEnabled(n)}function b(){r.downloads.onCreated.addListener(async e=>{await u();const t=e,n=t.finalUrl||t.url||"";!N(n)&&!_(t.tabId)||(await r.downloads.cancel(e.id).catch(()=>null),await r.downloads.erase({id:e.id}).catch(()=>null),await r.downloads.removeFile(e.id).catch(()=>null))})}function x(){r.webRequest.onSendHeaders.addListener(e=>{c.set(e.requestId,e)},{urls:["<all_urls>"]},["requestHeaders","extraHeaders"]),r.webRequest.onErrorOccurred.addListener(e=>{c.delete(e.requestId),a.delete(String(e.requestId))},{urls:["<all_urls>"]}),r.webRequest.onCompleted.addListener(e=>{c.delete(e.requestId),a.delete(String(e.requestId))},{urls:["<all_urls>"]}),r.webRequest.onHeadersReceived.addListener(e=>{G(e)},{urls:["<all_urls>"]},["responseHeaders"])}function f(){r.contextMenus.removeAll().then(async()=>{const e=await d();e.showContextOption&&r.contextMenus.create({id:D,title:"Download with Gomdown",visible:e.showContextOption,contexts:["all"]})}),r.contextMenus.onClicked.addListener(async e=>{const t=e.linkUrl||e.srcUrl||e.pageUrl;t&&await S(t)})}r.runtime.onMessage.addListener((e,t)=>{if(e?.type!=="capture-link-download")return;const n=String(e?.url||"").trim();if(!n)return Promise.resolve({ok:!1,error:"url is empty"});const o=Number(t?.tab?.id);return S(n,String(e?.referer||"")).then(s=>(s.ok&&(R(n),q(o)),s))});r.runtime.onInstalled.addListener(()=>{x(),b(),f(),u()});r.runtime.onStartup.addListener(()=>{x(),b(),f(),u()});r.storage.onChanged.addListener((e,t)=>{t==="sync"&&((e.hideChromeBar||e.useNativeHost||e.extensionStatus)&&u(),e.showContextOption&&f())});x();b();f();u();
|
||||
13
packages/edge/assets/index.ts-loader-DMyyuf2n.js
Normal file
@@ -0,0 +1,13 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
const injectTime = performance.now();
|
||||
(async () => {
|
||||
const { onExecute } = await import(
|
||||
/* @vite-ignore */
|
||||
chrome.runtime.getURL("assets/index.ts-BGLNJwsP.js")
|
||||
);
|
||||
onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } });
|
||||
})().catch(console.error);
|
||||
|
||||
})();
|
||||
1
packages/edge/assets/settings-Bo6W9Drl.js
Normal file
@@ -0,0 +1 @@
|
||||
import{b as e}from"./browser-polyfill-CZ_dLIqp.js";const t={extensionStatus:!0,useNativeHost:!0,activateAppOnDownload:!0,enableNotifications:!0,hideChromeBar:!0,showContextOption:!0,downloadFallback:!1,darkMode:!1,showOnlyAria:!1,minFileSize:0,blacklist:[],motrixPort:16800,motrixAPIkey:""};async function n(){const o=await e.storage.sync.get(Object.keys(t));return{extensionStatus:!!(o.extensionStatus??t.extensionStatus),useNativeHost:!!(o.useNativeHost??t.useNativeHost),activateAppOnDownload:!!(o.activateAppOnDownload??t.activateAppOnDownload),enableNotifications:!!(o.enableNotifications??t.enableNotifications),hideChromeBar:!!(o.hideChromeBar??t.hideChromeBar),showContextOption:!!(o.showContextOption??t.showContextOption),downloadFallback:!!(o.downloadFallback??t.downloadFallback),darkMode:!!(o.darkMode??t.darkMode),showOnlyAria:!!(o.showOnlyAria??t.showOnlyAria),minFileSize:Number(o.minFileSize??t.minFileSize),blacklist:Array.isArray(o.blacklist)?o.blacklist.map(a=>String(a)):t.blacklist,motrixPort:Number(o.motrixPort??t.motrixPort),motrixAPIkey:String(o.motrixAPIkey??t.motrixAPIkey)}}async function s(o){await e.storage.sync.set(o)}export{n as g,s};
|
||||
BIN
packages/edge/images/128.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
packages/edge/images/16.png
Normal file
|
After Width: | Height: | Size: 597 B |
BIN
packages/edge/images/32.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
packages/edge/images/48.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
packages/edge/images/dwld.png
Normal file
|
After Width: | Height: | Size: 553 B |
BIN
packages/edge/images/icon-large.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
68
packages/edge/manifest.json
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "Gomdown Helper",
|
||||
"description": "Send browser downloads to gdown",
|
||||
"version": "0.0.1",
|
||||
"default_locale": "en",
|
||||
"icons": {
|
||||
"16": "images/16.png",
|
||||
"32": "images/32.png",
|
||||
"48": "images/48.png",
|
||||
"128": "images/128.png"
|
||||
},
|
||||
"background": {
|
||||
"service_worker": "service-worker-loader.js",
|
||||
"type": "module"
|
||||
},
|
||||
"action": {
|
||||
"default_popup": "src/popup/index.html",
|
||||
"default_title": "Gomdown Helper",
|
||||
"default_icon": {
|
||||
"16": "images/16.png",
|
||||
"32": "images/32.png",
|
||||
"48": "images/48.png",
|
||||
"128": "images/128.png"
|
||||
}
|
||||
},
|
||||
"options_page": "src/config/index.html",
|
||||
"content_scripts": [
|
||||
{
|
||||
"js": [
|
||||
"assets/index.ts-loader-DMyyuf2n.js"
|
||||
],
|
||||
"matches": [
|
||||
"<all_urls>"
|
||||
],
|
||||
"run_at": "document_start",
|
||||
"all_frames": true
|
||||
}
|
||||
],
|
||||
"permissions": [
|
||||
"downloads",
|
||||
"downloads.shelf",
|
||||
"notifications",
|
||||
"storage",
|
||||
"contextMenus",
|
||||
"cookies",
|
||||
"webRequest",
|
||||
"nativeMessaging"
|
||||
],
|
||||
"host_permissions": [
|
||||
"<all_urls>"
|
||||
],
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"matches": [
|
||||
"<all_urls>"
|
||||
],
|
||||
"resources": [
|
||||
"images/*",
|
||||
"assets/browser-polyfill-CZ_dLIqp.js",
|
||||
"assets/downloadIntent-Dv31jC2S.js",
|
||||
"assets/index.ts-BGLNJwsP.js"
|
||||
],
|
||||
"use_dynamic_url": false
|
||||
}
|
||||
],
|
||||
"short_name": "Gomdown"
|
||||
}
|
||||
1
packages/edge/service-worker-loader.js
Normal file
@@ -0,0 +1 @@
|
||||
import './assets/index.ts-BnPsJZXz.js';
|
||||
16
packages/edge/src/config/index.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Gomdown Helper Settings</title>
|
||||
<script type="module" crossorigin src="/assets/index.html-B0Kfv8fq.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/browser-polyfill-CZ_dLIqp.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/client-CBvt1tWS.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/settings-Bo6W9Drl.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-B2D5FcJM.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
16
packages/edge/src/popup/index.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Gomdown Helper</title>
|
||||
<script type="module" crossorigin src="/assets/index.html-D-JbSuV5.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/browser-polyfill-CZ_dLIqp.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/client-CBvt1tWS.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/settings-Bo6W9Drl.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-BZvbrf4l.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
83
packages/firefox/.vite/manifest.json
Normal file
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"../../../../../@crx/manifest": {
|
||||
"file": "assets/crx-manifest.js-DthtiGNU.js",
|
||||
"name": "crx-manifest.js",
|
||||
"src": "../../../../../@crx/manifest",
|
||||
"isEntry": true
|
||||
},
|
||||
"_browser-polyfill-CZ_dLIqp.js": {
|
||||
"file": "assets/browser-polyfill-CZ_dLIqp.js",
|
||||
"name": "browser-polyfill"
|
||||
},
|
||||
"_client-CBvt1tWS.js": {
|
||||
"file": "assets/client-CBvt1tWS.js",
|
||||
"name": "client",
|
||||
"imports": [
|
||||
"_browser-polyfill-CZ_dLIqp.js"
|
||||
]
|
||||
},
|
||||
"_downloadIntent-Dv31jC2S.js": {
|
||||
"file": "assets/downloadIntent-Dv31jC2S.js",
|
||||
"name": "downloadIntent"
|
||||
},
|
||||
"_index.ts-loader-DMyyuf2n.js": {
|
||||
"file": "assets/index.ts-loader-DMyyuf2n.js",
|
||||
"src": "_index.ts-loader-DMyyuf2n.js"
|
||||
},
|
||||
"_settings-Bo6W9Drl.js": {
|
||||
"file": "assets/settings-Bo6W9Drl.js",
|
||||
"name": "settings",
|
||||
"imports": [
|
||||
"_browser-polyfill-CZ_dLIqp.js"
|
||||
]
|
||||
},
|
||||
"src/background/index.ts": {
|
||||
"file": "assets/index.ts-BnPsJZXz.js",
|
||||
"name": "index.ts",
|
||||
"src": "src/background/index.ts",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_browser-polyfill-CZ_dLIqp.js",
|
||||
"_downloadIntent-Dv31jC2S.js",
|
||||
"_settings-Bo6W9Drl.js"
|
||||
]
|
||||
},
|
||||
"src/config/index.html": {
|
||||
"file": "assets/index.html-B0Kfv8fq.js",
|
||||
"name": "index.html",
|
||||
"src": "src/config/index.html",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_client-CBvt1tWS.js",
|
||||
"_settings-Bo6W9Drl.js",
|
||||
"_browser-polyfill-CZ_dLIqp.js"
|
||||
],
|
||||
"css": [
|
||||
"assets/index-B2D5FcJM.css"
|
||||
]
|
||||
},
|
||||
"src/content/index.ts": {
|
||||
"file": "assets/index.ts-BGLNJwsP.js",
|
||||
"name": "index.ts",
|
||||
"src": "src/content/index.ts",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_browser-polyfill-CZ_dLIqp.js",
|
||||
"_downloadIntent-Dv31jC2S.js"
|
||||
]
|
||||
},
|
||||
"src/popup/index.html": {
|
||||
"file": "assets/index.html-D-JbSuV5.js",
|
||||
"name": "index.html",
|
||||
"src": "src/popup/index.html",
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"_client-CBvt1tWS.js",
|
||||
"_browser-polyfill-CZ_dLIqp.js",
|
||||
"_settings-Bo6W9Drl.js"
|
||||
],
|
||||
"css": [
|
||||
"assets/index-BZvbrf4l.css"
|
||||
]
|
||||
}
|
||||
}
|
||||
86
packages/firefox/_locales/en/messages.json
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"appName": {
|
||||
"message": "Motrix WebExtension",
|
||||
"description": "The name of the application"
|
||||
},
|
||||
"appShortName": {
|
||||
"message": "Motrix WebExt",
|
||||
"description": "The short_name (maximum of 12 characters recommended) is a short version of the app's name."
|
||||
},
|
||||
"appDescription": {
|
||||
"message": "WebExtension for Motrix download manager",
|
||||
"description": "The description of the application"
|
||||
},
|
||||
"browserActionTitle": {
|
||||
"message": "Motrix WebExtension",
|
||||
"description": "The title of the browser action button"
|
||||
},
|
||||
"extensionStatus": {
|
||||
"message": "Extension status:",
|
||||
"description": "Extension status"
|
||||
},
|
||||
"enableNotifications": {
|
||||
"message": "Enable notifications:",
|
||||
"description": "Enable Notifications"
|
||||
},
|
||||
"setKey": {
|
||||
"message": "Set Key",
|
||||
"description": "Set Key"
|
||||
},
|
||||
"setMinSize": {
|
||||
"message": "Set minimum file size (mb)",
|
||||
"description": "Set minimum file size"
|
||||
},
|
||||
"setSize": {
|
||||
"message": "Set size",
|
||||
"description": "Set size"
|
||||
},
|
||||
"keyInputPlaceholder": {
|
||||
"message": "Motrix API Key",
|
||||
"description": "Motrix API Key"
|
||||
},
|
||||
"blacklist": {
|
||||
"message": "Blacklist",
|
||||
"description": "Blacklist"
|
||||
},
|
||||
"saveBlacklist": {
|
||||
"message": "Save blacklist",
|
||||
"description": "Save blacklist"
|
||||
},
|
||||
"darkMode": {
|
||||
"message": "Dark mode",
|
||||
"description": "Dark mode"
|
||||
},
|
||||
"showOnlyAria": {
|
||||
"message": "Show only Motrix downloads in the popup",
|
||||
"description": "Show only Motrix downloads in the popup"
|
||||
},
|
||||
"hideChromeBar": {
|
||||
"message": "Hide chrome download bar",
|
||||
"description": "Hide chrome download bar"
|
||||
},
|
||||
"showContextOption": {
|
||||
"message": "Show \"Download with gdown\" context option",
|
||||
"description": "Show \"Download with gdown\" context option"
|
||||
},
|
||||
"downloadWithMotrix": {
|
||||
"message": "Download with gdown",
|
||||
"description": "Download with gdown"
|
||||
},
|
||||
"setPort": {
|
||||
"message": "Set Port",
|
||||
"description": "Set Port"
|
||||
},
|
||||
"downloadFallback": {
|
||||
"message": "If launching in gdown fails, use the browser's default download manager",
|
||||
"description": "If launching in gdown fails, use the browser's default download manager"
|
||||
},
|
||||
"useNativeHost": {
|
||||
"message": "Use Native Messaging host for downloads",
|
||||
"description": "Use Native Messaging host for downloads"
|
||||
},
|
||||
"activateAppOnDownload": {
|
||||
"message": "Activate gdown app when transfer starts",
|
||||
"description": "Activate gdown app when transfer starts"
|
||||
}
|
||||
}
|
||||
86
packages/firefox/_locales/zh/messages.json
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"appName": {
|
||||
"message": "Motrix 网页扩展",
|
||||
"description": "应用程序名称"
|
||||
},
|
||||
"appShortName": {
|
||||
"message": "Motrix 扩展",
|
||||
"description": "应用程序缩略名称"
|
||||
},
|
||||
"appDescription": {
|
||||
"message": "用于 Motrix 下载管理器的网页扩展",
|
||||
"description": "应用程序描述"
|
||||
},
|
||||
"browserActionTitle": {
|
||||
"message": "Motrix 网页扩展",
|
||||
"description": "浏览器操作按钮标题"
|
||||
},
|
||||
"extensionStatus": {
|
||||
"message": "扩展状态",
|
||||
"description": "扩展状态"
|
||||
},
|
||||
"enableNotifications": {
|
||||
"message": "允许桌面通知",
|
||||
"description": "允许桌面通知"
|
||||
},
|
||||
"setKey": {
|
||||
"message": "设置密钥",
|
||||
"description": "设置密钥"
|
||||
},
|
||||
"setMinSize": {
|
||||
"message": "设置最小下载文件 (mb)",
|
||||
"description": "设置最小下载文件"
|
||||
},
|
||||
"setSize": {
|
||||
"message": "设置大小",
|
||||
"description": "设置大小"
|
||||
},
|
||||
"keyInputPlaceholder": {
|
||||
"message": "Motrix API 密钥",
|
||||
"description": "Motrix API 密钥"
|
||||
},
|
||||
"blacklist": {
|
||||
"message": "黑名单",
|
||||
"description": "黑名单"
|
||||
},
|
||||
"saveBlacklist": {
|
||||
"message": "保存黑名单",
|
||||
"description": "保存黑名单"
|
||||
},
|
||||
"darkMode": {
|
||||
"message": "深色模式",
|
||||
"description": "深色模式"
|
||||
},
|
||||
"showOnlyAria": {
|
||||
"message": "在弹出窗口中仅显示 Motrix 下载",
|
||||
"description": "在弹出窗口中仅显示 Motrix 下载"
|
||||
},
|
||||
"hideChromeBar": {
|
||||
"message": "隐藏 Chrome 下载栏",
|
||||
"description": "隐藏 Chrome 下载栏"
|
||||
},
|
||||
"showContextOption": {
|
||||
"message": "显示“使用 gdown 下载”右键选项",
|
||||
"description": "显示“使用 gdown 下载”右键选项"
|
||||
},
|
||||
"downloadWithMotrix": {
|
||||
"message": "使用 gdown 下载",
|
||||
"description": "使用 gdown 下载"
|
||||
},
|
||||
"setPort": {
|
||||
"message": "设置端口",
|
||||
"description": "设置端口"
|
||||
},
|
||||
"downloadFallback": {
|
||||
"message": "如果 gdown 启动失败,则使用浏览器的默认下载管理器",
|
||||
"description": "如果 gdown 启动失败,则使用浏览器的默认下载管理器"
|
||||
},
|
||||
"useNativeHost": {
|
||||
"message": "使用 Native Messaging 主机传输下载",
|
||||
"description": "使用 Native Messaging 主机传输下载"
|
||||
},
|
||||
"activateAppOnDownload": {
|
||||
"message": "下载转交时激活 gdown 应用",
|
||||
"description": "下载转交时激活 gdown 应用"
|
||||
}
|
||||
}
|
||||
1
packages/firefox/assets/browser-polyfill-CZ_dLIqp.js
Normal file
8
packages/firefox/assets/client-CBvt1tWS.js
Normal file
1
packages/firefox/assets/downloadIntent-Dv31jC2S.js
Normal file
@@ -0,0 +1 @@
|
||||
const s=/\.(zip|7z|rar|tar|gz|bz2|xz|dmg|pkg|exe|msi|iso|torrent|pdf|mp4|mkv|mp3|flac|apk|deb|rpm|ipa|img|bin)(?:$|[?#])/i,p=/^(text\/html|text\/plain|application\/json|application\/javascript|application\/xml|text\/xml)/i,d=/(^|\/)(download|downloads|dl|get|file|files|attachment|attachments)(\/|$)/i;function i(n,t){try{return new URL(n,t)}catch{return null}}function w(n,t){const e=i(n,t);return e?e.toString():String(n||"")}function a(n,t){const e=i(n,t);return e?s.test(e.pathname||""):s.test(String(n||""))}function g(n){const t=String(n||"").replace(/-/g,"+").replace(/_/g,"/");try{return atob(t)}catch{return""}}function m(n){if(!d.test(n))return!1;const t=String(n||"").split("/").filter(Boolean),e=t[t.length-1]||"";return!e||e.includes(".")?!1:/^[a-z0-9_-]{12,}$/i.test(e)}function h(n){const t=n.searchParams,e=t.get("golink");if(e){const r=g(e);if(r&&s.test(r))return!0}const o=t.get("filename")||t.get("file")||t.get("name")||t.get("out");return!!(o&&s.test(o)||t.has("attachment")||t.has("download"))}function y(n,t){const e=i(n,t);return!e||!["http:","https:","ftp:"].includes(e.protocol)?!1:!!(a(e.toString())||h(e)||m(e.pathname||""))}function L(n){const t=Array.isArray(n?.responseHeaders)?n.responseHeaders:[],e=l=>{const c=String(l||"").toLowerCase(),u=t.find(f=>String(f?.name||"").toLowerCase()===c);return String(u?.value||"")},o=e("content-disposition").toLowerCase(),r=e("content-type").toLowerCase();return o.includes("attachment")||a(n.url||"")?!0:!r||p.test(r)?!1:r.startsWith("application/")||r.startsWith("audio/")||r.startsWith("video/")}export{L as a,y as i,w as n};
|
||||
1
packages/firefox/assets/index-B2D5FcJM.css
Normal file
@@ -0,0 +1 @@
|
||||
:root{color-scheme:dark;font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}body{margin:0;background:#141820;color:#e6ebf7}.wrap{max-width:860px;margin:0 auto;padding:24px;display:grid;gap:12px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.card{background:#1f2530;border:1px solid #323b4a;border-radius:10px;padding:12px;display:grid;gap:8px}label{font-size:12px;color:#aeb8cc}input,textarea{border:1px solid #3c4658;border-radius:7px;background:#121721;color:#e6ebf7;padding:8px 10px}input[type=checkbox]{width:16px;height:16px}.row{display:flex;align-items:center;justify-content:space-between;gap:8px}.actions{display:flex;gap:8px}button{border:1px solid #5967f4;background:#5967f4;color:#fff;border-radius:8px;padding:8px 12px;font-weight:600;cursor:pointer}button.ghost{background:#232a36;border-color:#3b4658}@media(max-width:900px){.grid{grid-template-columns:1fr}}
|
||||
1
packages/firefox/assets/index-BZvbrf4l.css
Normal file
@@ -0,0 +1 @@
|
||||
:root{color-scheme:dark;font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}body{margin:0;background:#151821;color:#e7ebf7;width:360px}.container{padding:14px;display:grid;gap:10px}h1{margin:0;font-size:14px}.field{display:grid;gap:6px}label{font-size:12px;color:#aeb6cc}input[type=text],input[type=number]{height:32px;border:1px solid #3e4658;border-radius:6px;padding:0 10px;background:#202532;color:#e7ebf7}.toggle{display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#cdd5ea}button{height:34px;border:1px solid #5562f0;border-radius:8px;background:#5562f0;color:#fff;font-weight:600;cursor:pointer}.status{font-size:12px;color:#8fe0a6;min-height:14px}
|
||||
3
packages/firefox/assets/index.html-B0Kfv8fq.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import{c as p,j as e,R as a}from"./client-CBvt1tWS.js";import{g as j,s as m}from"./settings-Bo6W9Drl.js";import"./browser-polyfill-CZ_dLIqp.js";function u(){const[t,i]=a.useState(null),[l,r]=a.useState(""),[h,d]=a.useState("");a.useEffect(()=>{j().then(s=>{i(s),r((s.blacklist||[]).join(`
|
||||
`))})},[]);const n=(s,c)=>{i(o=>o&&{...o,[s]:c})},x=async()=>{if(!t)return;const s={...t,minFileSize:Number(t.minFileSize||0),motrixPort:Number(t.motrixPort||16800),blacklist:l.split(`
|
||||
`).map(c=>c.trim()).filter(Boolean)};await m(s),i(s),d("Saved"),window.setTimeout(()=>d(""),1500)};return t?e.jsxs("div",{className:"wrap",children:[e.jsx("h1",{children:"Gomdown Helper Settings"}),e.jsxs("div",{className:"grid",children:[e.jsxs("section",{className:"card",children:[e.jsx("label",{children:"RPC Secret"}),e.jsx("input",{value:t.motrixAPIkey,onChange:s=>n("motrixAPIkey",s.target.value)}),e.jsx("label",{children:"RPC Port"}),e.jsx("input",{type:"number",value:t.motrixPort,onChange:s=>n("motrixPort",Number(s.target.value||16800))}),e.jsx("label",{children:"Min file size (MB)"}),e.jsx("input",{type:"number",value:t.minFileSize,onChange:s=>n("minFileSize",Number(s.target.value||0))}),e.jsx("label",{children:"Blacklist (one per line)"}),e.jsx("textarea",{rows:8,value:l,onChange:s=>r(s.target.value)})]}),e.jsxs("section",{className:"card",children:[e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Extension enabled"}),e.jsx("input",{type:"checkbox",checked:t.extensionStatus,onChange:s=>n("extensionStatus",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Enable notifications"}),e.jsx("input",{type:"checkbox",checked:t.enableNotifications,onChange:s=>n("enableNotifications",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Use native host"}),e.jsx("input",{type:"checkbox",checked:t.useNativeHost,onChange:s=>n("useNativeHost",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Activate app on download"}),e.jsx("input",{type:"checkbox",checked:t.activateAppOnDownload,onChange:s=>n("activateAppOnDownload",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Hide browser download shelf"}),e.jsx("input",{type:"checkbox",checked:t.hideChromeBar,onChange:s=>n("hideChromeBar",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Show context menu option"}),e.jsx("input",{type:"checkbox",checked:t.showContextOption,onChange:s=>n("showContextOption",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Download fallback"}),e.jsx("input",{type:"checkbox",checked:t.downloadFallback,onChange:s=>n("downloadFallback",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Dark mode"}),e.jsx("input",{type:"checkbox",checked:t.darkMode,onChange:s=>n("darkMode",s.target.checked)})]}),e.jsxs("div",{className:"row",children:[e.jsx("span",{children:"Show only aria downloads"}),e.jsx("input",{type:"checkbox",checked:t.showOnlyAria,onChange:s=>n("showOnlyAria",s.target.checked)})]})]})]}),e.jsxs("div",{className:"actions",children:[e.jsx("button",{onClick:x,children:"Save"}),e.jsx("button",{className:"ghost",onClick:()=>window.close(),children:"Close"})]}),e.jsx("div",{children:h})]}):e.jsx("div",{className:"wrap",children:"Loading..."})}p.createRoot(document.getElementById("root")).render(e.jsx(a.StrictMode,{children:e.jsx(u,{})}));
|
||||
1
packages/firefox/assets/index.html-D-JbSuV5.js
Normal file
@@ -0,0 +1 @@
|
||||
import{c as g,j as e,R as c}from"./client-CBvt1tWS.js";import{b as a}from"./browser-polyfill-CZ_dLIqp.js";import{g as m,s as p}from"./settings-Bo6W9Drl.js";function j(){const[s,o]=c.useState(null),[l,r]=c.useState("");c.useEffect(()=>{m().then(o)},[]);const n=(t,h)=>{o(i=>i&&{...i,[t]:h})},d=async()=>{s&&(await p(s),r("Saved"),window.setTimeout(()=>r(""),1200))},u=async()=>{const t=a.runtime.getURL("src/config/index.html");await a.tabs.create({url:t})},x=async()=>{const t=a.runtime.getURL("src/history/index.html");await a.tabs.create({url:t})};return s?e.jsxs("div",{className:"container",children:[e.jsx("h1",{children:"Gomdown Helper"}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:"RPC Secret"}),e.jsx("input",{type:"text",value:s.motrixAPIkey,onChange:t=>n("motrixAPIkey",t.target.value),placeholder:"aria2 rpc secret"})]}),e.jsxs("div",{className:"field",children:[e.jsx("label",{children:"RPC Port"}),e.jsx("input",{type:"number",value:s.motrixPort,onChange:t=>n("motrixPort",Number(t.target.value||16800))})]}),e.jsxs("label",{className:"toggle",children:["Extension Enabled",e.jsx("input",{type:"checkbox",checked:s.extensionStatus,onChange:t=>n("extensionStatus",t.target.checked)})]}),e.jsxs("label",{className:"toggle",children:["Use Native Host",e.jsx("input",{type:"checkbox",checked:s.useNativeHost,onChange:t=>n("useNativeHost",t.target.checked)})]}),e.jsxs("label",{className:"toggle",children:["Activate gdown App",e.jsx("input",{type:"checkbox",checked:s.activateAppOnDownload,onChange:t=>n("activateAppOnDownload",t.target.checked)})]}),e.jsx("button",{onClick:d,children:"Save"}),e.jsx("button",{onClick:u,children:"Settings"}),e.jsx("button",{onClick:x,children:"History"}),e.jsx("div",{className:"status",children:l})]}):e.jsx("div",{className:"container",children:"Loading..."})}g.createRoot(document.getElementById("root")).render(e.jsx(c.StrictMode,{children:e.jsx(j,{})}));
|
||||
1
packages/firefox/assets/index.ts-BGLNJwsP.js
Normal file
@@ -0,0 +1 @@
|
||||
import{b as w}from"./browser-polyfill-CZ_dLIqp.js";import{i as o,n as h}from"./downloadIntent-Dv31jC2S.js";const p=8e3,e=new Map;function m(){const r=Date.now();for(const[n,t]of e.entries())t<=r&&e.delete(n)}async function i(r,n){const t=h(r,window.location.href);if(!t)return!1;if(m(),e.has(t))return!0;e.set(t,Date.now()+p);try{if((await w.runtime.sendMessage({type:"capture-link-download",url:t,referer:n||document.referrer||window.location.href}))?.ok)return!0}catch{}return e.delete(t),!1}function u(r){return r?r instanceof HTMLAnchorElement?r:r instanceof Element?r.closest("a[href]"):null:null}function a(r){return!!(r.metaKey||r.ctrlKey||r.shiftKey||r.altKey)}async function d(r){if(r.defaultPrevented||a(r))return;const n=u(r.target);if(!n)return;const t=n.href||"";!t||!o(t,window.location.href)||(r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation(),await i(t,document.referrer||window.location.href))}function l(r){const n=u(r.target);if(!n)return;const t=n.href||"";!t||!o(t,window.location.href)||a(r)||(r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation(),i(t,document.referrer||window.location.href))}document.addEventListener("pointerdown",r=>{r.button===0&&l(r)},!0);document.addEventListener("mousedown",r=>{r.button===0&&l(r)},!0);document.addEventListener("click",r=>{r.button===0&&d(r)},!0);document.addEventListener("keydown",r=>{if(r.key!=="Enter"||r.defaultPrevented||a(r))return;const n=u(r.target);if(!n)return;const t=n.href||"";!t||!o(t,window.location.href)||(r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation(),i(t,document.referrer||window.location.href))},!0);document.addEventListener("auxclick",r=>{r.button===1&&d(r)},!0);function g(){try{const r=window.open.bind(window);window.open=function(t,f,s){const c=String(t||"").trim();return c&&o(c,window.location.href)?(i(c,window.location.href),null):r(t,f,s)}}catch{}try{const r=HTMLAnchorElement.prototype.click;HTMLAnchorElement.prototype.click=function(){const t=this.href||this.getAttribute("href")||"";if(t&&o(t,window.location.href)){i(t,document.referrer||window.location.href);return}r.call(this)}}catch{}}g();
|
||||
1
packages/firefox/assets/index.ts-BnPsJZXz.js
Normal file
@@ -0,0 +1 @@
|
||||
import{b as r}from"./browser-polyfill-CZ_dLIqp.js";import{n as v,a as k}from"./downloadIntent-Dv31jC2S.js";import{g as d}from"./settings-Bo6W9Drl.js";const C="org.gdown.nativehost";async function L(e){return r.runtime.sendNativeMessage(C,{action:"addUri",...e})}async function I(){return r.runtime.sendNativeMessage(C,{action:"focus"})}const p="history";async function H(){const t=(await r.storage.local.get([p]))[p];return Array.isArray(t)?t:[]}async function M(e){await r.storage.local.set({[p]:e.slice(0,300)})}async function T(e){const t=await H(),n=t.findIndex(o=>o.gid===e.gid);n>=0?t[n]=e:t.unshift(e),await M(t)}const y=8e3,A=7e3,D="gomdown-helper-download-context-menu-option",c=new Map,w=new Map,g=new Map,m=new Map,a=new Map,h=new Map;function l(e){try{const t=new URL(e),n=(t.pathname||"/").replace(/\/+$/,"")||"/";return`${t.protocol}//${t.host}${n}`.toLowerCase()}catch{return String(e||"").toLowerCase()}}function i(e){const t=Date.now();for(const[n,o]of e.entries())o<=t&&e.delete(n)}function R(e){const t=Date.now()+y;w.set(v(e),t),g.set(l(e),t)}function q(e){!Number.isInteger(e)||(e??-1)<0||h.set(e,Date.now()+y)}function N(e){i(w),i(g);const t=v(e);return w.has(t)||g.has(l(e))}function _(e){return i(h),!Number.isInteger(e)||(e??-1)<0?!1:h.has(e)}function E(e){return i(m),m.has(l(e))}function F(e){m.set(l(e),Date.now()+A)}function O(e){return i(a),!!e&&a.has(e)}function P(e){e&&a.set(e,Date.now()+y)}async function $(){try{await I()}catch{}}async function S(e,t=""){if(E(e))return{ok:!1,error:"duplicate transfer suppressed"};const n=await d();if(!n.extensionStatus)return{ok:!1,error:"extension disabled"};if(!n.motrixAPIkey)return{ok:!1,error:"motrixAPIkey is not set"};try{const o=await L({url:e,rpcPort:n.motrixPort,rpcSecret:n.motrixAPIkey,referer:t,split:64});if(!o?.ok)return{ok:!1,error:o?.error||"native host addUri failed"};n.activateAppOnDownload&&await $(),F(e);const s=String(o?.gid||o?.requestId||`pending-${Date.now()}`),U=(()=>{try{return new URL(e).pathname}catch{return""}})().split("/").filter(Boolean).pop()||e;return await T({gid:s,downloader:"native",startTime:new Date().toISOString(),icon:"/images/32.png",name:decodeURIComponent(U),path:null,status:o?.pending?"queued":"downloading",size:0,downloaded:0}),n.enableNotifications&&await r.notifications.create(`gomdown-transfer-${Date.now()}`,{type:"basic",iconUrl:"/images/icon-large.png",title:"Gomdown Helper",message:"Download sent to gdown"}),{ok:!0}}catch(o){return{ok:!1,error:String(o)}}}async function z(e){if(e.type!=="main_frame"||(e.method||"").toUpperCase()!=="GET"||typeof e.statusCode=="number"&&(e.statusCode<200||e.statusCode>299))return!1;const t=await d();if(!t.extensionStatus||!t.motrixAPIkey)return!1;const n=String(Array.isArray(e?.responseHeaders)&&e.responseHeaders.find(s=>String(s?.name||"").toLowerCase()==="content-length")?.value||""),o=Number(n||0);return t.minFileSize>0&&o>0&&o<t.minFileSize*1024*1024?!1:k(e)}async function G(e){if(O(e.requestId)||!await z(e))return;const n=c.get(e.requestId),o=String(n?.documentUrl||n?.originUrl||n?.initiator||n?.url||"");(await S(e.url,o)).ok&&(P(e.requestId),R(e.url),q(e.tabId))}async function u(){const e=r.downloads;if(!e.setShelfEnabled)return;const t=await d();if(!t.extensionStatus)return;const n=t.useNativeHost?!1:!t.hideChromeBar;await e.setShelfEnabled(n)}function b(){r.downloads.onCreated.addListener(async e=>{await u();const t=e,n=t.finalUrl||t.url||"";!N(n)&&!_(t.tabId)||(await r.downloads.cancel(e.id).catch(()=>null),await r.downloads.erase({id:e.id}).catch(()=>null),await r.downloads.removeFile(e.id).catch(()=>null))})}function x(){r.webRequest.onSendHeaders.addListener(e=>{c.set(e.requestId,e)},{urls:["<all_urls>"]},["requestHeaders","extraHeaders"]),r.webRequest.onErrorOccurred.addListener(e=>{c.delete(e.requestId),a.delete(String(e.requestId))},{urls:["<all_urls>"]}),r.webRequest.onCompleted.addListener(e=>{c.delete(e.requestId),a.delete(String(e.requestId))},{urls:["<all_urls>"]}),r.webRequest.onHeadersReceived.addListener(e=>{G(e)},{urls:["<all_urls>"]},["responseHeaders"])}function f(){r.contextMenus.removeAll().then(async()=>{const e=await d();e.showContextOption&&r.contextMenus.create({id:D,title:"Download with Gomdown",visible:e.showContextOption,contexts:["all"]})}),r.contextMenus.onClicked.addListener(async e=>{const t=e.linkUrl||e.srcUrl||e.pageUrl;t&&await S(t)})}r.runtime.onMessage.addListener((e,t)=>{if(e?.type!=="capture-link-download")return;const n=String(e?.url||"").trim();if(!n)return Promise.resolve({ok:!1,error:"url is empty"});const o=Number(t?.tab?.id);return S(n,String(e?.referer||"")).then(s=>(s.ok&&(R(n),q(o)),s))});r.runtime.onInstalled.addListener(()=>{x(),b(),f(),u()});r.runtime.onStartup.addListener(()=>{x(),b(),f(),u()});r.storage.onChanged.addListener((e,t)=>{t==="sync"&&((e.hideChromeBar||e.useNativeHost||e.extensionStatus)&&u(),e.showContextOption&&f())});x();b();f();u();
|
||||
13
packages/firefox/assets/index.ts-loader-DMyyuf2n.js
Normal file
@@ -0,0 +1,13 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
const injectTime = performance.now();
|
||||
(async () => {
|
||||
const { onExecute } = await import(
|
||||
/* @vite-ignore */
|
||||
chrome.runtime.getURL("assets/index.ts-BGLNJwsP.js")
|
||||
);
|
||||
onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } });
|
||||
})().catch(console.error);
|
||||
|
||||
})();
|
||||
1
packages/firefox/assets/settings-Bo6W9Drl.js
Normal file
@@ -0,0 +1 @@
|
||||
import{b as e}from"./browser-polyfill-CZ_dLIqp.js";const t={extensionStatus:!0,useNativeHost:!0,activateAppOnDownload:!0,enableNotifications:!0,hideChromeBar:!0,showContextOption:!0,downloadFallback:!1,darkMode:!1,showOnlyAria:!1,minFileSize:0,blacklist:[],motrixPort:16800,motrixAPIkey:""};async function n(){const o=await e.storage.sync.get(Object.keys(t));return{extensionStatus:!!(o.extensionStatus??t.extensionStatus),useNativeHost:!!(o.useNativeHost??t.useNativeHost),activateAppOnDownload:!!(o.activateAppOnDownload??t.activateAppOnDownload),enableNotifications:!!(o.enableNotifications??t.enableNotifications),hideChromeBar:!!(o.hideChromeBar??t.hideChromeBar),showContextOption:!!(o.showContextOption??t.showContextOption),downloadFallback:!!(o.downloadFallback??t.downloadFallback),darkMode:!!(o.darkMode??t.darkMode),showOnlyAria:!!(o.showOnlyAria??t.showOnlyAria),minFileSize:Number(o.minFileSize??t.minFileSize),blacklist:Array.isArray(o.blacklist)?o.blacklist.map(a=>String(a)):t.blacklist,motrixPort:Number(o.motrixPort??t.motrixPort),motrixAPIkey:String(o.motrixAPIkey??t.motrixAPIkey)}}async function s(o){await e.storage.sync.set(o)}export{n as g,s};
|
||||
BIN
packages/firefox/images/128.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
packages/firefox/images/16.png
Normal file
|
After Width: | Height: | Size: 597 B |
BIN
packages/firefox/images/32.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
packages/firefox/images/48.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
packages/firefox/images/dwld.png
Normal file
|
After Width: | Height: | Size: 553 B |
BIN
packages/firefox/images/icon-large.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
72
packages/firefox/manifest.json
Normal file
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "Gomdown Helper",
|
||||
"description": "Send browser downloads to gdown",
|
||||
"version": "0.0.1",
|
||||
"default_locale": "en",
|
||||
"icons": {
|
||||
"16": "images/16.png",
|
||||
"32": "images/32.png",
|
||||
"48": "images/48.png",
|
||||
"128": "images/128.png"
|
||||
},
|
||||
"background": {
|
||||
"service_worker": "service-worker-loader.js"
|
||||
},
|
||||
"action": {
|
||||
"default_popup": "src/popup/index.html",
|
||||
"default_title": "Gomdown Helper",
|
||||
"default_icon": {
|
||||
"16": "images/16.png",
|
||||
"32": "images/32.png",
|
||||
"48": "images/48.png",
|
||||
"128": "images/128.png"
|
||||
}
|
||||
},
|
||||
"options_page": "src/config/index.html",
|
||||
"content_scripts": [
|
||||
{
|
||||
"js": [
|
||||
"assets/index.ts-loader-DMyyuf2n.js"
|
||||
],
|
||||
"matches": [
|
||||
"<all_urls>"
|
||||
],
|
||||
"run_at": "document_start",
|
||||
"all_frames": true
|
||||
}
|
||||
],
|
||||
"permissions": [
|
||||
"downloads",
|
||||
"downloads.shelf",
|
||||
"notifications",
|
||||
"storage",
|
||||
"contextMenus",
|
||||
"cookies",
|
||||
"webRequest",
|
||||
"nativeMessaging"
|
||||
],
|
||||
"host_permissions": [
|
||||
"<all_urls>"
|
||||
],
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"matches": [
|
||||
"<all_urls>"
|
||||
],
|
||||
"resources": [
|
||||
"images/*",
|
||||
"assets/browser-polyfill-CZ_dLIqp.js",
|
||||
"assets/downloadIntent-Dv31jC2S.js",
|
||||
"assets/index.ts-BGLNJwsP.js"
|
||||
],
|
||||
"use_dynamic_url": false
|
||||
}
|
||||
],
|
||||
"short_name": "Gomdown",
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": "gomdown-helper@projectdx"
|
||||
}
|
||||
}
|
||||
}
|
||||
1
packages/firefox/service-worker-loader.js
Normal file
@@ -0,0 +1 @@
|
||||
import './assets/index.ts-BnPsJZXz.js';
|
||||
16
packages/firefox/src/config/index.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Gomdown Helper Settings</title>
|
||||
<script type="module" crossorigin src="/assets/index.html-B0Kfv8fq.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/browser-polyfill-CZ_dLIqp.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/client-CBvt1tWS.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/settings-Bo6W9Drl.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-B2D5FcJM.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
16
packages/firefox/src/popup/index.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Gomdown Helper</title>
|
||||
<script type="module" crossorigin src="/assets/index.html-D-JbSuV5.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/browser-polyfill-CZ_dLIqp.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/client-CBvt1tWS.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/settings-Bo6W9Drl.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-BZvbrf4l.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
packages/gomdown-helper.v0.0.1.chrome.zip
Normal file
BIN
packages/gomdown-helper.v0.0.1.edge.zip
Normal file
BIN
packages/gomdown-helper.v0.0.1.firefox.zip
Normal file
BIN
packages/gomdown-helper.v0.0.10.chrome.zip
Normal file
BIN
packages/gomdown-helper.v0.0.2.chrome.zip
Normal file
BIN
packages/gomdown-helper.v0.0.3.chrome.zip
Normal file
BIN
packages/gomdown-helper.v0.0.4.chrome.zip
Normal file
BIN
packages/gomdown-helper.v0.0.5.chrome.zip
Normal file
BIN
packages/gomdown-helper.v0.0.6.chrome.zip
Normal file
BIN
packages/gomdown-helper.v0.0.7.chrome.zip
Normal file
BIN
packages/gomdown-helper.v0.0.8.chrome.zip
Normal file
BIN
packages/gomdown-helper.v0.0.9.chrome.zip
Normal file
86
public/_locales/en/messages.json
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"appName": {
|
||||
"message": "Motrix WebExtension",
|
||||
"description": "The name of the application"
|
||||
},
|
||||
"appShortName": {
|
||||
"message": "Motrix WebExt",
|
||||
"description": "The short_name (maximum of 12 characters recommended) is a short version of the app's name."
|
||||
},
|
||||
"appDescription": {
|
||||
"message": "WebExtension for Motrix download manager",
|
||||
"description": "The description of the application"
|
||||
},
|
||||
"browserActionTitle": {
|
||||
"message": "Motrix WebExtension",
|
||||
"description": "The title of the browser action button"
|
||||
},
|
||||
"extensionStatus": {
|
||||
"message": "Extension status:",
|
||||
"description": "Extension status"
|
||||
},
|
||||
"enableNotifications": {
|
||||
"message": "Enable notifications:",
|
||||
"description": "Enable Notifications"
|
||||
},
|
||||
"setKey": {
|
||||
"message": "Set Key",
|
||||
"description": "Set Key"
|
||||
},
|
||||
"setMinSize": {
|
||||
"message": "Set minimum file size (mb)",
|
||||
"description": "Set minimum file size"
|
||||
},
|
||||
"setSize": {
|
||||
"message": "Set size",
|
||||
"description": "Set size"
|
||||
},
|
||||
"keyInputPlaceholder": {
|
||||
"message": "Motrix API Key",
|
||||
"description": "Motrix API Key"
|
||||
},
|
||||
"blacklist": {
|
||||
"message": "Blacklist",
|
||||
"description": "Blacklist"
|
||||
},
|
||||
"saveBlacklist": {
|
||||
"message": "Save blacklist",
|
||||
"description": "Save blacklist"
|
||||
},
|
||||
"darkMode": {
|
||||
"message": "Dark mode",
|
||||
"description": "Dark mode"
|
||||
},
|
||||
"showOnlyAria": {
|
||||
"message": "Show only Motrix downloads in the popup",
|
||||
"description": "Show only Motrix downloads in the popup"
|
||||
},
|
||||
"hideChromeBar": {
|
||||
"message": "Hide chrome download bar",
|
||||
"description": "Hide chrome download bar"
|
||||
},
|
||||
"showContextOption": {
|
||||
"message": "Show \"Download with gdown\" context option",
|
||||
"description": "Show \"Download with gdown\" context option"
|
||||
},
|
||||
"downloadWithMotrix": {
|
||||
"message": "Download with gdown",
|
||||
"description": "Download with gdown"
|
||||
},
|
||||
"setPort": {
|
||||
"message": "Set Port",
|
||||
"description": "Set Port"
|
||||
},
|
||||
"downloadFallback": {
|
||||
"message": "If launching in gdown fails, use the browser's default download manager",
|
||||
"description": "If launching in gdown fails, use the browser's default download manager"
|
||||
},
|
||||
"useNativeHost": {
|
||||
"message": "Use Native Messaging host for downloads",
|
||||
"description": "Use Native Messaging host for downloads"
|
||||
},
|
||||
"activateAppOnDownload": {
|
||||
"message": "Activate gdown app when transfer starts",
|
||||
"description": "Activate gdown app when transfer starts"
|
||||
}
|
||||
}
|
||||
86
public/_locales/zh/messages.json
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"appName": {
|
||||
"message": "Motrix 网页扩展",
|
||||
"description": "应用程序名称"
|
||||
},
|
||||
"appShortName": {
|
||||
"message": "Motrix 扩展",
|
||||
"description": "应用程序缩略名称"
|
||||
},
|
||||
"appDescription": {
|
||||
"message": "用于 Motrix 下载管理器的网页扩展",
|
||||
"description": "应用程序描述"
|
||||
},
|
||||
"browserActionTitle": {
|
||||
"message": "Motrix 网页扩展",
|
||||
"description": "浏览器操作按钮标题"
|
||||
},
|
||||
"extensionStatus": {
|
||||
"message": "扩展状态",
|
||||
"description": "扩展状态"
|
||||
},
|
||||
"enableNotifications": {
|
||||
"message": "允许桌面通知",
|
||||
"description": "允许桌面通知"
|
||||
},
|
||||
"setKey": {
|
||||
"message": "设置密钥",
|
||||
"description": "设置密钥"
|
||||
},
|
||||
"setMinSize": {
|
||||
"message": "设置最小下载文件 (mb)",
|
||||
"description": "设置最小下载文件"
|
||||
},
|
||||
"setSize": {
|
||||
"message": "设置大小",
|
||||
"description": "设置大小"
|
||||
},
|
||||
"keyInputPlaceholder": {
|
||||
"message": "Motrix API 密钥",
|
||||
"description": "Motrix API 密钥"
|
||||
},
|
||||
"blacklist": {
|
||||
"message": "黑名单",
|
||||
"description": "黑名单"
|
||||
},
|
||||
"saveBlacklist": {
|
||||
"message": "保存黑名单",
|
||||
"description": "保存黑名单"
|
||||
},
|
||||
"darkMode": {
|
||||
"message": "深色模式",
|
||||
"description": "深色模式"
|
||||
},
|
||||
"showOnlyAria": {
|
||||
"message": "在弹出窗口中仅显示 Motrix 下载",
|
||||
"description": "在弹出窗口中仅显示 Motrix 下载"
|
||||
},
|
||||
"hideChromeBar": {
|
||||
"message": "隐藏 Chrome 下载栏",
|
||||
"description": "隐藏 Chrome 下载栏"
|
||||
},
|
||||
"showContextOption": {
|
||||
"message": "显示“使用 gdown 下载”右键选项",
|
||||
"description": "显示“使用 gdown 下载”右键选项"
|
||||
},
|
||||
"downloadWithMotrix": {
|
||||
"message": "使用 gdown 下载",
|
||||
"description": "使用 gdown 下载"
|
||||
},
|
||||
"setPort": {
|
||||
"message": "设置端口",
|
||||
"description": "设置端口"
|
||||
},
|
||||
"downloadFallback": {
|
||||
"message": "如果 gdown 启动失败,则使用浏览器的默认下载管理器",
|
||||
"description": "如果 gdown 启动失败,则使用浏览器的默认下载管理器"
|
||||
},
|
||||
"useNativeHost": {
|
||||
"message": "使用 Native Messaging 主机传输下载",
|
||||
"description": "使用 Native Messaging 主机传输下载"
|
||||
},
|
||||
"activateAppOnDownload": {
|
||||
"message": "下载转交时激活 gdown 应用",
|
||||
"description": "下载转交时激活 gdown 应用"
|
||||
}
|
||||
}
|
||||
BIN
public/images/128.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
public/images/16.png
Normal file
|
After Width: | Height: | Size: 597 B |
BIN
public/images/32.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
public/images/48.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
public/images/dwld.png
Normal file
|
After Width: | Height: | Size: 553 B |
BIN
public/images/icon-large.png
Normal file
|
After Width: | Height: | Size: 29 KiB |