Skip to content

Commit 0eb4775

Browse files
committed
opt code
1 parent 4f4a947 commit 0eb4775

5 files changed

Lines changed: 27 additions & 24 deletions

File tree

dist/build.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/build.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/content_script.js

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
//this is auto generated by [npm run dev/build] command
22
const nowHost = window.location.host;
33
if(nowHost === 'annom.com'){
4+
function parseTime(testTime) {
5+
const a = testTime.split(' ');
6+
const result = {
7+
y: 0, m: 0, d: 0, h: 0, mi: 0, s: 0,
8+
};
9+
if (a.length >= 2) {
10+
const ymd = a[0].split('-');
11+
result.y = Number(ymd[0]);
12+
result.m = Number(ymd[1]);
13+
result.d = Number(ymd[2]);
14+
const hms = a[1].split(':');
15+
result.h = Number(hms[0]);
16+
result.mi = Number(hms[1]);
17+
result.s = Number(hms[2]);
18+
}
19+
return result;
20+
}
21+
422
setInterval(() => {
523
const list = document.getElementsByClassName('content');
624
if (list.length === 3) {
@@ -17,7 +35,8 @@ setInterval(() => {
1735
const timeValueS = timeValue.split(' ');
1836
if (timeValueS.length === 3 && timeValueS[2] === 'PST') {
1937
const re = parseTime(timeValue);
20-
const stamp = new Date(re.y, re.m - 1, re.d, re.h, re.mi, re.s).getTime() / 1000 + 16 * 3600;
38+
const stamp = new Date(re.y, re.m - 1, re.d, re.h, re.mi, re.s).getTime()
39+
/ 1000 + 16 * 3600;
2140
j[i].innerText = new Date(stamp * 1000).toLocaleString();
2241
}
2342
}
@@ -26,23 +45,6 @@ setInterval(() => {
2645
}
2746
}
2847
}, 1000);
29-
function parseTime(testTime) {
30-
const a = testTime.split(' ');
31-
const result = {
32-
y: 0, m: 0, d: 0, h: 0, mi: 0, s: 0,
33-
};
34-
if (a.length >= 2) {
35-
const ymd = a[0].split('-');
36-
result.y = Number(ymd[0]);
37-
result.m = Number(ymd[1]);
38-
result.d = Number(ymd[2]);
39-
const hms = a[1].split(':');
40-
result.h = Number(hms[0]);
41-
result.mi = Number(hms[1]);
42-
result.s = Number(hms[2]);
43-
}
44-
return result;
45-
}
4648
}
4749
if(nowHost === 'blog.csdn.net'){
4850
// 设置csdn烦人的【展开阅读全文】、【弹出登录】功能

src/components/Iptv.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export default {
145145
for (let i = 0; i < this.list.length; i += 1) {
146146
this.nowIsCheck = true;
147147
fetchGet(this.list[i].url).then((res) => {
148-
if (this.checkFirstLineIsRight(res.data)) {
148+
if (this.checkFirstLineIsRight(res)) {
149149
this.list[i].status = 1;
150150
} else {
151151
throw new Error('first line is not m3u');

src/components/Sim.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export default {
8080
headers: [],
8181
activeTab: 'body',
8282
postData: '',
83+
resultResponseHeader: [],
8384
};
8485
},
8586
methods: {

0 commit comments

Comments
 (0)