Skip to content

Commit

Permalink
Super_preloaderPlus_one 6.2.7
Browse files Browse the repository at this point in the history
- 改善 Greasemonkey 2.0 的兼容性
  • Loading branch information
ywzhaiqi committed Jul 11, 2014
1 parent 3730c44 commit 4ce3d3c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 32 deletions.
6 changes: 3 additions & 3 deletions Super_preloaderPlus/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ function init(window, document) {

if(prefs.enableHistory){
try {
unsafeWindow.history.pushState(null, docTitle, cplink);
window.history.pushState(null, docTitle, cplink);
} catch(e) {}
}

Expand Down Expand Up @@ -1466,9 +1466,9 @@ function init(window, document) {
clearTimeout(timeout);
timeout = setTimeout(scroll, 100);
}
unsafeWindow.addEventListener('scroll', timeoutfn, false);
window.addEventListener('scroll', timeoutfn, false);
remove.push(function() {
unsafeWindow.removeEventListener('scroll', timeoutfn, false);
window.removeEventListener('scroll', timeoutfn, false);
});

autoPO = {
Expand Down
2 changes: 1 addition & 1 deletion Super_preloaderPlus/src/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// @namespace https://github.com/ywzhaiqi
// @description 预读+翻页..全加速你的浏览体验...
// @author ywzhaiqi && NLF(原作者)
// @version 6.2.6
// @version 6.2.7
// @homepageURL https://greasyfork.org/scripts/293-super-preloaderplus-one
// @updateURL https://greasyfork.org/scripts/293-super-preloaderplus-one/code/Super_preloaderPlus_one.meta.js
// @downloadURL https://greasyfork.org/scripts/293-super-preloaderplus-one/code/Super_preloaderPlus_one.user.js
Expand Down
17 changes: 5 additions & 12 deletions Super_preloaderPlus/src/rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,25 +163,18 @@ var SITEINFO=[
stylish: 'hr.rgsep{display:none;}' +
'.rg_meta{display:none}.bili{display:inline-block;margin:0 6px 6px 0;overflow:hidden;position:relative;vertical-align:top}._HG{margin-bottom:2px;margin-right:2px}',
documentFilter: function(doc){
// 修正下一页的图片
var x = doc.evaluate('//script/text()[contains(self::text(), "data:image/")]', doc, null, 9, null).singleNodeValue;
if (x) {
new Function('document, window, google', x.nodeValue)(doc, unsafeWindow, unsafeWindow.google);
}
},
startFilter: function(win, doc) { // 只作用一次
// 移除 Google 重定向
if (unsafeWindow.rwt) {
try {
Object.defineProperty(unsafeWindow, 'rwt', {
value: function() { return ''; },
});
} catch (e) {}
} else { // Chrome 原生的情况
var script = doc.createElement('script');
script.type = 'text/javascript';
script.textContent = 'window.rwt = function(){}';
doc.documentElement.appendChild(script);
}
var script = doc.createElement('script');
script.type = 'text/javascript';
script.textContent = 'window.rwt = function(){}';
doc.documentElement.appendChild(script);

// 移动相关搜索到第一页
var brs = doc.getElementById('brs'),
Expand Down
25 changes: 9 additions & 16 deletions Super_preloaderPlus/super_preloaderplus_one.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// @namespace https://github.com/ywzhaiqi
// @description 预读+翻页..全加速你的浏览体验...
// @author ywzhaiqi && NLF(原作者)
// @version 6.2.6
// @version 6.2.7
// @homepageURL https://greasyfork.org/scripts/293-super-preloaderplus-one
// @updateURL https://greasyfork.org/scripts/293-super-preloaderplus-one/code/Super_preloaderPlus_one.meta.js
// @downloadURL https://greasyfork.org/scripts/293-super-preloaderplus-one/code/Super_preloaderPlus_one.user.js
Expand Down Expand Up @@ -208,25 +208,18 @@ var SITEINFO=[
stylish: 'hr.rgsep{display:none;}' +
'.rg_meta{display:none}.bili{display:inline-block;margin:0 6px 6px 0;overflow:hidden;position:relative;vertical-align:top}._HG{margin-bottom:2px;margin-right:2px}',
documentFilter: function(doc){
// 修正下一页的图片
var x = doc.evaluate('//script/text()[contains(self::text(), "data:image/")]', doc, null, 9, null).singleNodeValue;
if (x) {
new Function('document, window, google', x.nodeValue)(doc, unsafeWindow, unsafeWindow.google);
}
},
startFilter: function(win, doc) { // 只作用一次
// 移除 Google 重定向
if (unsafeWindow.rwt) {
try {
Object.defineProperty(unsafeWindow, 'rwt', {
value: function() { return ''; },
});
} catch (e) {}
} else { // Chrome 原生的情况
var script = doc.createElement('script');
script.type = 'text/javascript';
script.textContent = 'window.rwt = function(){}';
doc.documentElement.appendChild(script);
}
var script = doc.createElement('script');
script.type = 'text/javascript';
script.textContent = 'window.rwt = function(){}';
doc.documentElement.appendChild(script);

// 移动相关搜索到第一页
var brs = doc.getElementById('brs'),
Expand Down Expand Up @@ -4924,7 +4917,7 @@ function init(window, document) {

if(prefs.enableHistory){
try {
unsafeWindow.history.pushState(null, docTitle, cplink);
window.history.pushState(null, docTitle, cplink);
} catch(e) {}
}

Expand Down Expand Up @@ -5042,9 +5035,9 @@ function init(window, document) {
clearTimeout(timeout);
timeout = setTimeout(scroll, 100);
}
unsafeWindow.addEventListener('scroll', timeoutfn, false);
window.addEventListener('scroll', timeoutfn, false);
remove.push(function() {
unsafeWindow.removeEventListener('scroll', timeoutfn, false);
window.removeEventListener('scroll', timeoutfn, false);
});

autoPO = {
Expand Down

0 comments on commit 4ce3d3c

Please sign in to comment.