ppkdebug

调试用存档

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/426347/930199/ppkdebug.js

  1. console.log(GM_info);
  2. GM_xmlhttpRequest({
  3. url: "https://www.baidu.com",
  4. method: "HEAD",
  5. onload: function(response) {
  6. console.log(response.responseHeaders);
  7. }
  8. });
  9.  
  10. try
  11. {
  12. GM_xmlhttpRequest({
  13. method: "GET",
  14. url: "https://www.baidu.com/",
  15. headers: {
  16. "User-Agent": "Mozilla/5.0", // If not specified, navigator.userAgent will be used.
  17. "Accept": "text/xml" // If not specified, browser defaults will be used.
  18. },
  19. onload: function(response) {
  20. var responseXML = null;
  21. // Inject responseXML into existing Object (only appropriate for XML content).
  22. if (!response.responseXML) {
  23. responseXML = new DOMParser()
  24. .parseFromString(response.responseText, "text/xml");
  25. }
  26.  
  27. console.log([
  28. response.status,
  29. response.statusText,
  30. response.readyState,
  31. response.responseHeaders,
  32. response.responseText,
  33. response.finalUrl,
  34. responseXML
  35. ].join("\n"));
  36. }
  37. });
  38. /*console.log( GM_xmlhttpRequest( {
  39. method: "GET",
  40. url: "https://www.baidu.com/",
  41. // synchronous: true 不支持
  42. }
  43. ).readyState );*/
  44. }
  45. catch (e)
  46. {
  47. console.log(e);
  48. }
  49.  
  50. try
  51. {
  52. console.log('收录查询工具 v1');
  53.  
  54. if(location.href.indexOf('exam_formal')>-1) {
  55. let reg2 = '/,/g';
  56. let preCount =0, count = 0;
  57. const id = location.href.match(reg)[1];
  58. $.get('http://cplatform.kingdee.com/queryQuestionByCourseId?id=' + id, function(res){
  59. if(res.rows){
  60. for(let i = 0; i < res.rows.length; i++) {
  61. let myAnswer = '';
  62. let myOptions =[];
  63. const options = res.rows[i].optionList;
  64. let answer = '';
  65. for (let j = 0; j < options.length; j++) {
  66. myOptions.push(options[j].content.replace(reg2, ','));
  67. myAnswer += (options[j].isQuestionAnswer === 1) ? ((answer ? ',' : '') + String.fromCharCode(65 + j)) : '';
  68. }
  69. GM_xmlhttpRequest({
  70. method: "post",
  71. url: 'http://192.168.0.109:8080/subject',
  72. data: 'typeName=【' + id + '】' + res.data.title + '&content=' +res.rows[i].title + '&answer='+myAnswer+'&options=' +JSON.stringify(myOptions),
  73. headers: {
  74. "Content-Type": "application/x-www-form-urlencoded"
  75. },
  76. onload: function(res){
  77. if(res.status === 200){
  78. console.log('成功')
  79. }else{
  80. console.log('失败')
  81. console.log(res)
  82. }
  83. },
  84. onerror : function(err){
  85. console.log('error')
  86. console.log(err)
  87. }
  88. });
  89. }
  90. // 用于在页面上显示参考答案
  91. $('.col-xs-12').bind('DOMSubtreeModified', function(e){
  92. count++;
  93. setTimeout(function(){
  94. if(preCount !== count){
  95. preCount = count;
  96. }else{
  97. $('.col-xs-12').unbind('DOMSubtreeModified');
  98. $('.look_answer_exam').show();
  99. }
  100. },100);
  101. });
  102. }
  103. });
  104. }
  105. }
  106. catch (e){
  107. console.log(e);
  108. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址