Skip to content

Commit

Permalink
修复:Gleam没有输入框时报错(#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
HCLonely committed Sep 6, 2024
1 parent dde90fe commit 1f9d7b2
Show file tree
Hide file tree
Showing 17 changed files with 83 additions and 71 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ jobs:
uses: softprops/action-gh-release@v1
with:
prerelease: false
tag_name: v4.4.9
name: 4.4.9
body: |-
- 新增:自动完成Gleam输入框任务
- 优化:增加Gleam可识别任务
tag_name: v4.4.10
name: 4.4.10
body: '- 修复:Gleam没有输入框时报错(#29)'
files: |-
dist/auto-task-v4-for-giveawaysu.user.js
dist/auto-task-v4.compatibility.user.js
Expand Down
2 changes: 1 addition & 1 deletion dist/auto-task-v4-for-giveawaysu.all.user.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/auto-task-v4-for-giveawaysu.user.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 12 additions & 10 deletions dist/auto-task-v4.all.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name auto-task-v4
// @namespace auto-task-v4
// @version 4.4.9
// @version 4.4.10
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
// @author HCLonely
Expand Down Expand Up @@ -9518,15 +9518,17 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
unsafeWindow.$hookTimer?.setSpeed(1);
const expandInfo = $task.find('.expandable');
const input = expandInfo.find('input')[0];
const evt = new Event('input', {
bubbles: true,
cancelable: true,
composed: true
});
const valuelimit = [ ...expandInfo.text().matchAll(/"(.+?)"/g) ].at(-1)?.[1];
input.value = valuelimit || 'vloot';
input.dispatchEvent(evt);
await delay(1e3);
if (input) {
const evt = new Event('input', {
bubbles: true,
cancelable: true,
composed: true
});
const valuelimit = [ ...expandInfo.text().matchAll(/"(.+?)"/g) ].at(-1)?.[1];
input.value = valuelimit || 'vloot';
input.dispatchEvent(evt);
await delay(1e3);
}
await this.#checkSync();
const continueBtn = $task.find('.expandable').find('span:contains(Continue),button:contains(Continue)');
for (const button of continueBtn) {
Expand Down
4 changes: 2 additions & 2 deletions dist/auto-task-v4.compatibility.all.user.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/auto-task-v4.compatibility.user.js

Large diffs are not rendered by default.

22 changes: 12 additions & 10 deletions dist/auto-task-v4.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name auto-task-v4
// @namespace auto-task-v4
// @version 4.4.9
// @version 4.4.10
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
// @author HCLonely
Expand Down Expand Up @@ -9499,15 +9499,17 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
unsafeWindow.$hookTimer?.setSpeed(1);
const expandInfo = $task.find('.expandable');
const input = expandInfo.find('input')[0];
const evt = new Event('input', {
bubbles: true,
cancelable: true,
composed: true
});
const valuelimit = [ ...expandInfo.text().matchAll(/"(.+?)"/g) ].at(-1)?.[1];
input.value = valuelimit || 'vloot';
input.dispatchEvent(evt);
await delay(1e3);
if (input) {
const evt = new Event('input', {
bubbles: true,
cancelable: true,
composed: true
});
const valuelimit = [ ...expandInfo.text().matchAll(/"(.+?)"/g) ].at(-1)?.[1];
input.value = valuelimit || 'vloot';
input.dispatchEvent(evt);
await delay(1e3);
}
await this.#checkSync();
const continueBtn = $task.find('.expandable').find('span:contains(Continue),button:contains(Continue)');
for (const button of continueBtn) {
Expand Down
6 changes: 6 additions & 0 deletions doc/docs/logs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ lang: zh-CN

## V4.4

### V4.4.10

[Release](https://github.com/HCLonely/auto-task-v4/releases/tag/v4.4.10)

- 修复:Gleam没有输入框时报错([#29](https://github.com/HCLonely/auto-task-v4/issues/29))

### V4.4.9

[Release](https://github.com/HCLonely/auto-task-v4/releases/tag/v4.4.9)
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"name": "auto-task-v4",
"version": "4.4.9",
"version": "4.4.10",
"change": [
"新增:自动完成Gleam输入框任务",
"优化:增加Gleam可识别任务"
"修复:Gleam没有输入框时报错(#29)"
],
"description": "赠Key站自动任务脚本",
"main": "package.json",
Expand Down
2 changes: 1 addition & 1 deletion page/dist/auto-task-v4-for-giveawaysu.all.user.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion page/dist/auto-task-v4-for-giveawaysu.user.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 12 additions & 10 deletions page/dist/auto-task-v4.all.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name auto-task-v4
// @namespace auto-task-v4
// @version 4.4.9
// @version 4.4.10
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
// @author HCLonely
Expand Down Expand Up @@ -9518,15 +9518,17 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
unsafeWindow.$hookTimer?.setSpeed(1);
const expandInfo = $task.find('.expandable');
const input = expandInfo.find('input')[0];
const evt = new Event('input', {
bubbles: true,
cancelable: true,
composed: true
});
const valuelimit = [ ...expandInfo.text().matchAll(/"(.+?)"/g) ].at(-1)?.[1];
input.value = valuelimit || 'vloot';
input.dispatchEvent(evt);
await delay(1e3);
if (input) {
const evt = new Event('input', {
bubbles: true,
cancelable: true,
composed: true
});
const valuelimit = [ ...expandInfo.text().matchAll(/"(.+?)"/g) ].at(-1)?.[1];
input.value = valuelimit || 'vloot';
input.dispatchEvent(evt);
await delay(1e3);
}
await this.#checkSync();
const continueBtn = $task.find('.expandable').find('span:contains(Continue),button:contains(Continue)');
for (const button of continueBtn) {
Expand Down
4 changes: 2 additions & 2 deletions page/dist/auto-task-v4.compatibility.all.user.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions page/dist/auto-task-v4.compatibility.user.js

Large diffs are not rendered by default.

22 changes: 12 additions & 10 deletions page/dist/auto-task-v4.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name auto-task-v4
// @namespace auto-task-v4
// @version 4.4.9
// @version 4.4.10
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
// @author HCLonely
Expand Down Expand Up @@ -9499,15 +9499,17 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
unsafeWindow.$hookTimer?.setSpeed(1);
const expandInfo = $task.find('.expandable');
const input = expandInfo.find('input')[0];
const evt = new Event('input', {
bubbles: true,
cancelable: true,
composed: true
});
const valuelimit = [ ...expandInfo.text().matchAll(/"(.+?)"/g) ].at(-1)?.[1];
input.value = valuelimit || 'vloot';
input.dispatchEvent(evt);
await delay(1e3);
if (input) {
const evt = new Event('input', {
bubbles: true,
cancelable: true,
composed: true
});
const valuelimit = [ ...expandInfo.text().matchAll(/"(.+?)"/g) ].at(-1)?.[1];
input.value = valuelimit || 'vloot';
input.dispatchEvent(evt);
await delay(1e3);
}
await this.#checkSync();
const continueBtn = $task.find('.expandable').find('span:contains(Continue),button:contains(Continue)');
for (const button of continueBtn) {
Expand Down
7 changes: 3 additions & 4 deletions page/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"name": "auto-task-v4",
"version": "4.4.9",
"version": "4.4.10",
"change": [
"新增:自动完成Gleam输入框任务",
"优化:增加Gleam可识别任务"
"修复:Gleam没有输入框时报错(#29)"
],
"description": "赠Key站自动任务脚本",
"main": "package.json",
Expand Down Expand Up @@ -47,7 +46,7 @@
"ts-loader": "^9.2.6",
"typescript": "^4.4.4",
"uglify-js": "^3.14.5",
"webpack": "^5.76.0",
"webpack": "^5.94.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.9.1",
"webpack-obfuscator": "^3.5.1",
Expand Down
16 changes: 9 additions & 7 deletions src/scripts/website/Gleam.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @Author : HCLonely
* @Date : 2021-11-19 14:42:43
* @LastEditTime : 2024-09-06 10:30:30
* @LastEditTime : 2024-09-06 16:40:01
* @LastEditors : HCLonely
* @FilePath : /auto-task-v4/src/scripts/website/Gleam.ts
* @Description : https://gleam.io
Expand Down Expand Up @@ -285,12 +285,14 @@ class Gleam extends Website {

const expandInfo = $task.find('.expandable');
const input = expandInfo.find('input')[0];
const evt = new Event("input", { bubbles: true, cancelable: true, composed: true });
const valuelimit = [...expandInfo.text().matchAll(/"(.+?)"/g)].at(-1)?.[1];
input.value = valuelimit || 'vloot';
// expandInfo.find('input').val(this.options.vlootUsername);
input.dispatchEvent(evt);
await delay(1000);
if (input) {
const evt = new Event("input", { bubbles: true, cancelable: true, composed: true });
const valuelimit = [...expandInfo.text().matchAll(/"(.+?)"/g)].at(-1)?.[1];
input.value = valuelimit || 'vloot';
// expandInfo.find('input').val(this.options.vlootUsername);
input.dispatchEvent(evt);
await delay(1000);
}

await this.#checkSync();
const continueBtn = $task.find('.expandable').find('span:contains(Continue),button:contains(Continue)');
Expand Down

0 comments on commit 1f9d7b2

Please sign in to comment.