From f6b5aaa138a77cd6fc308167903be6f979cd8b54 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 18 Aug 2021 19:03:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=88=E8=87=AA=E5=8A=A8=E6=97=A0=E7=BC=9D=E7=BF=BB=E9=A1=B5?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3dm-Enhanced.user.js | 6 ++---- 52pojie-Enhanced.user.js | 6 ++---- Hostloc-Enhanced.user.js | 6 ++---- V2ex-Enhanced.user.js | 10 ++++------ Zhiyoo-Enhanced.user.js | 6 ++---- 5 files changed, 12 insertions(+), 22 deletions(-) diff --git a/3dm-Enhanced.user.js b/3dm-Enhanced.user.js index 99838c3..b98eca0 100644 --- a/3dm-Enhanced.user.js +++ b/3dm-Enhanced.user.js @@ -288,10 +288,8 @@ // 修改自 https://greasyfork.org/scripts/14178 , https://github.com/machsix/Super-preloader var ShowPager = { getFullHref: function (e) { - if(e == null) return ''; - 'string' != typeof e && (e = e.getAttribute('href')); - var t = this.getFullHref.a; - return t || (this.getFullHref.a = t = document.createElement('a')), (t.href = e), t.href; + if (e != null && e.nodeType === 1 && e.href && e.href.slice(0,4) === 'http') return e.href; + return ''; }, createDocumentByString: function (e) { if (e) { diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index 3e481d1..7ebe0c5 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -277,10 +277,8 @@ function showPager() { ShowPager = { getFullHref: function (e) { - if(e == null) return ''; - 'string' != typeof e && (e = e.getAttribute('href')); - var t = this.getFullHref.a; - return t || (this.getFullHref.a = t = document.createElement('a')), (t.href = e), t.href; + if (e != null && e.nodeType === 1 && e.href && e.href.slice(0,4) === 'http') return e.href; + return ''; }, createDocumentByString: function (e) { if (e) { diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index fa79277..93ef3f5 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -567,10 +567,8 @@ // 修改自 https://greasyfork.org/scripts/14178 , https://github.com/machsix/Super-preloader var ShowPager = { getFullHref: function (e) { - if(e == null) return ''; - 'string' != typeof e && (e = e.getAttribute('href')); - var t = this.getFullHref.a; - return t || (this.getFullHref.a = t = document.createElement('a')), (t.href = e), t.href; + if (e != null && e.nodeType === 1 && e.href && e.href.slice(0,4) === 'http') return e.href; + return ''; }, createDocumentByString: function (e) { if (e) { diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index 4df8110..159ecec 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -325,7 +325,7 @@ if (event.target==this) { if (document.querySelector('.box.reply-box-sticky')) { document.getElementById('undock-button').click(); - }else{ + } else { let _top = document.body.scrollTop + document.documentElement.scrollTop; document.getElementById('reply_content').focus(); window.scrollTo(0,_top);console.log(_top); @@ -336,7 +336,7 @@ /*document.getElementById('reply_233').onclick = function () { if (document.querySelector('.box.reply-box-sticky')) { document.getElementById('undock-button').click(); - }else{ + } else { let _top = document.body.scrollTop + document.documentElement.scrollTop; document.getElementById('reply_content').focus(); window.scrollTo(0,_top);console.log(_top); @@ -405,10 +405,8 @@ // 修改自 https://greasyfork.org/scripts/14178 , https://github.com/machsix/Super-preloader var ShowPager = { getFullHref: function (e) { - if(e == null) return ''; - 'string' != typeof e && (e = e.getAttribute('href')); - var t = this.getFullHref.a; - return t || (this.getFullHref.a = t = document.createElement('a')), (t.href = e), t.href; + if (e != null && e.nodeType === 1 && e.href && e.href.slice(0,4) === 'http') return e.href; + return ''; }, createDocumentByString: function (e) { if (e) { diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js index b0877ae..579d7ed 100644 --- a/Zhiyoo-Enhanced.user.js +++ b/Zhiyoo-Enhanced.user.js @@ -352,10 +352,8 @@ // 修改自 https://greasyfork.org/scripts/14178 , https://github.com/machsix/Super-preloader var ShowPager = { getFullHref: function (e) { - if(e == null) return ''; - 'string' != typeof e && (e = e.getAttribute('href')); - var t = this.getFullHref.a; - return t || (this.getFullHref.a = t = document.createElement('a')), (t.href = e), t.href; + if (e != null && e.nodeType === 1 && e.href && e.href.slice(0,4) === 'http') return e.href; + return ''; }, createDocumentByString: function (e) { if (e) {