mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-07 00:50:27 +00:00
feat: extension support (#78)
This commit is contained in:
118 files changed
+6971
-780
No files matched your search
+13
@@ -0,0 +1,13 @@
|
||||
gopeed.events.onResolve(async function (ctx) {
|
||||
ctx.res = {
|
||||
name: "test",
|
||||
files: Array(2).fill(true).map((_, i) => ({
|
||||
name: `test-${i}.txt`,
|
||||
size: 1024,
|
||||
req: {
|
||||
url: ctx.req.url + "/" + i,
|
||||
}
|
||||
}),
|
||||
),
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "basic",
|
||||
"title": "gopeed extension basic test",
|
||||
"version": "0.0.1",
|
||||
"scripts": [
|
||||
{
|
||||
"event": "onResolve",
|
||||
"matches": [
|
||||
"*://github.com/*"
|
||||
],
|
||||
"entry": "index.js"
|
||||
}
|
||||
],
|
||||
"settings": [
|
||||
{
|
||||
"name": "ua",
|
||||
"title": "User-Agent",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user