Greasy Fork

Greasy Fork is available in English.

考试资料网跳转显示答案

对单个题目进行跳转,使得跳转后的页面显示题目的答案。期间可能需要验证,遇到问题可以在GitHub issue我~

当前为 2018-12-24 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name            考试资料网跳转显示答案
// @namespace       https://github.com/cuifeiran/ppkao/
// @version         0.1.3
// @description     对单个题目进行跳转,使得跳转后的页面显示题目的答案。期间可能需要验证,遇到问题可以在GitHub issue我~
// @author          Dave
// @match           *://www.ppkao.com/tiku/shiti/*
// @match           *://www.ppkao.com/kaoti/*
// @include         *://www.ppkao.com/tiku/shiti/*
// @include         *://www.ppkao.com/shiti/*
// @include         *://www.ppkao.com/kaoti/*
// @include         *://www.ppkao.com/daan/*
//@contributionURL
// @grant           none
// ==/UserScript==

(function() {
 'use strict';
//清除限制题目访问数量的cookie
 var Days = 30;
 var exp = new Date();
 exp.setTime(exp.getTime() + Days*24*60*60*1000);
 document.cookie="PPKAO=PPKAOSTID=&PPKAOCEID=&PPKAOSJID=&UserName=&EDays=; domain=ppkao.com;expires="+exp.toGMTString()+";path=/";
//获取当前页面URL
 var iSite = window.location.href;
 var reg = /[1-9][0-9]*/g; 
 var numList = iSite.match(reg);   
 var isKaoti =new RegExp("kaoti").test(iSite);
 var isTiku =new RegExp("tiku").test(iSite);
 var isShiti =new RegExp("shiti").test(iSite);
 var isDaan =new RegExp("daan").test(iSite);
 var sUrl="";
 if (isKaoti===true){sUrl='https://api.ppkao.com/mnkc/kaoti/?id='+ numList;window.location.href =sUrl;}
    else{
        if(isTiku===true){sUrl='https://api.ppkao.com/mnkc/tiku/?id='+ numList;window.location.href =sUrl;}
        else{
            if(isShiti===true){sUrl='https://api.ppkao.com/mnkc/shiti/?id='+ numList;window.location.href =sUrl;}
            else{
                if(isDaan===true){
                    var html = '<div id="showQRcode" style="position: fixed;right:30px;bottom: 0px;"><a style="font-size: 14px;display:block;color:red;" onclick="$(this).parent().remove();" hidden="javascripe:void(0)" >不想打赏脚本作者,点击此处关闭</a><img width="420" height="210" src="https://s1.ax1x.com/2018/12/11/FJ47an.jpg"></img></div>'
                    var div = document.createElement('div');
                    div.setAttribute('id', 'showQRcode');
                    div.innerHTML = html;
                    document.body.appendChild(div);
                }
            }
        }
     }

   })();