This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 源: https://sf-static.b0.upaiyun.com/v-5703995e/global/js/debug.js | |
/* | |
监控js错误并上报 | |
wtser@sf.gg | |
*/ | |
window.onerror = function(msg, url, line, col, error) { | |
if (msg !== "Script error." && !url) { | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$headers = [ // 构造IP | |
'CLIENT-IP: 8.8.8.8', | |
'X-FORWARDED-FOR: 8.8.8.8', | |
]; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1:8000/server.php'); | |
curl_setopt($ch, CURLOPT_REFERER, 'http://www.baidu.com/'); // 构造来路 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nodes = document.getElementsByTagName("*"); | |
var events = []; | |
ev = lookEvents(document); | |
if (ev) { | |
events.push({el: document, ev: ev}); | |
} | |
for (var i=0, l=nodes.length; i<l; i++) { | |
var ev = lookEvents(nodes[i]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Test Suite</title> | |
<style> | |
#results li.pass {color: green;} | |
#results li.fail {color: red;} | |
</style> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(document) { // title提示 | |
var titleTime; | |
var oldTitle = document.title; | |
var shortcut = document.getElementById('shortcut'); | |
document.addEventListener('visibilitychange', function() { | |
if (document.hidden) { | |
document.title = '(●—●)咦,去哪儿啊?'; | |
clearTimeout(titleTime); | |
shortcut.href = 'images/fail.ico'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var some = Array.prototype.some; | |
function hasClass1(name){ | |
if (!name) { | |
return false | |
} | |
return some.call(this, function(el){ | |
return this.test(el.className) | |
}, new RegExp('(^|\\s)' + name + '(\\s|$)')); |
NewerOlder