您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
网上学院函数库:弹出窗口改为新标签页
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.icu/scripts/395997/769683/wsxy_windowToTab.js
// ==UserScript== // @name wsxy_windowToTab // @namespace Vionlentmonkey // @version 0.1 // @description 网上学院函数库:弹出窗口改为新标签页 // @require https://greasyfork.org/scripts/395748-wsxy-getdata/code/wsxy_getData.js // @grant none // ==/UserScript== /** 最新知识库。 * 年终考试题库在此公布,需要层层打开 iframe 最终获取 swf 地址,然后以 IE 打开, * 打印所有页,输出 PDF,二次打印输出 PDF,再用 Word 等进行 OCR。 */ const openKnowledge = () => { const knowledges = document.querySelectorAll('#knowledgeType a[title][href="#"]'); for (let knowledge of knowledges) { const kURL = location.origin + '/sfxzwsxy/jypxks/modules/learn/document/learn/document_learn_text.jsp?fkNodePk=' + knowledge .getAttribute('onclick') .split('(')[1] .split(')')[0]; //console.log(kURL); knowledge.href = kURL; knowledge.onclick = ''; knowledge.target = '_blank'; } }; // 清理两处“参加考试”按钮,使其点击时在新标签页打开考题及答案。 const handelExamList = async exams => { for (let exam of exams) { const examURL = location.origin + '/sfxzwsxy/' + exam.getAttribute('onclick').split("'")[1]; exam.href = examURL; exam.onclick = ''; exam.target = '_blank'; let course_pk = ''; let answerURL = ''; // 在线考试 - 课程考试 iframe if (examURL.includes('course_pk=')) { coursePk = examURL.split('course_pk=')[1].split('&')[0]; answerURL = location.origin + '/sfxzwsxy//jypxks/modules/train/course/subject_list.jsp?coursePk=' + coursePk + '&op=view'; } // 首页 - 考试提醒 - 课程考试 else if (exam.getAttribute('title')) { const csDataObj = await getCourseData(); const exam_courses = csDataObj.exam_courses; const title = exam.getAttribute('title'); for (let e of exam_courses) { if (e.course_name === title) { course_pk = String(e.course_pk); answerURL = location.origin + '/sfxzwsxy//jypxks/modules/train/course/subject_list.jsp?coursePk=' + course_pk + '&op=view'; } } } exam.addEventListener('click', () => { GM_openInTab(answerURL, true); GM_notification('答案已同步在隔壁标签页打开。\n暂请考试结束后手动关闭。'); }); } };