Skip to content
This repository was archived by the owner on Oct 18, 2019. It is now read-only.

Commit f5e3540

Browse files
committed
优化加载,去多余console
1 parent 28e3507 commit f5e3540

1 file changed

Lines changed: 13 additions & 16 deletions

File tree

dnspod_1080p.js

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// ==UserScript==
22
// @name [Zeusro]宽版 dnspod.cn
33
// @namespace https://www.zeusro.tech/
4-
// @version 0.2.1
4+
// @version 1.0.0
55
// @description 魔改 dnspod 域名配置页
66
// @author Zeusro
77
// @supportURL https://github.com/zeusro
88
// @match *://www.dnspod.cn/console/dns/*
99
// @match *://www.dnspod.cn/console/dns
10+
// @match *://www.dnspod.cn/console/*
1011
// @grant none
1112
// @license GPL-3.0-or-later
1213
// @compatible chrome
@@ -18,8 +19,7 @@
1819

1920
//等待iframe加载
2021
setTimeout(function () {
21-
main()
22-
22+
main()
2323
}, 2500)
2424

2525

@@ -65,6 +65,9 @@
6565
return
6666
}
6767
// console.log("set containers")
68+
if(!containers[0]){
69+
return
70+
}
6871
containers[0].setAttribute("style", "width:100%")
6972
var main = currentDocument.getElementById('main')
7073
if (main) {
@@ -134,12 +137,13 @@
134137
this.childNodes[1].childNodes &&
135138
this.childNodes[1].childNodes[1].childNodes &&
136139
this.childNodes[1].childNodes[1].childNodes[9]) {
137-
checkCurrentDocument()
138-
console.log("记录类型")
140+
// checkCurrentDocument()
141+
// if (!currentDocument) {
142+
// getCurrentDocument()
143+
// }
139144
//记录类型
140145
this.childNodes[1].childNodes[1].childNodes[5].childNodes[1].setAttribute("style", "width: 100px;")
141146
//记录值
142-
console.log("记录值")
143147
this.childNodes[1].childNodes[1].childNodes[9].childNodes[1].setAttribute("style", "width: 278px;")
144148
}
145149
fixCancelBehavior()
@@ -154,15 +158,14 @@
154158
return
155159
}
156160
createRecord.addEventListener("click", function () {
157-
console.log("create-record")
158-
getCurrentDocument()
161+
// console.log("create-record")
162+
// getCurrentDocument()
159163
setTimeout(function () {
160164
var entryList = currentDocument.getElementsByClassName("entry")
161165
if (!entryList || !entryList[0]) {
162-
console.log("no entry")
166+
console.warn("no entry")
163167
return
164168
}
165-
console.dir(entryList[0])
166169
//记录类型
167170
entryList[0].childNodes[1].childNodes[5].childNodes[1].setAttribute("style", "width: 100px;")
168171
//记录值
@@ -188,12 +191,6 @@
188191
}
189192
}
190193

191-
function checkCurrentDocument() {
192-
if (!currentDocument) {
193-
getCurrentDocument()
194-
}
195-
}
196-
197194
function addGlobalStyle_1080p() {
198195
//es 6
199196
var css = `

0 commit comments

Comments
 (0)