Open san3Xian opened 4 years ago
// ==UserScript== // @name 腾讯课堂-过时课程入口显现 // @namespace http://tampermonkey.net/ // @version 1.0 // @description 腾讯课堂-过期课程播放按钮 // @author WILO // @supportURL https://github.com/easyjack/randomMark/issues/20 // @match https://ke.qq.com/course/* // @icon https://ke.qq.com/favicon.ico // @grant none // @run-at document-end // ==/UserScript== //var term_id = document.getElementsByClassName("class-content js-term-item js-term-baseinfo class-content--no-des active")[0].getAttribute("data-termid"); var cource_id = metaData.terms[0].cid; var term_id = metaData.terms[0].term_id; if(document.getElementById("js-imgtext")){ var button_bar= document.getElementById("js-imgtext").getElementsByClassName("text-right text-right--pay")[0].getElementsByClassName("oper-bar")[0]; console.log(button_bar); var button_player=document.createElement("span"); button_player.setAttribute("class","btn-join btn-default"); //button_player.setAttribute("onclick","window.location.href='/webcourse/index.html#cid=" + cource_id + "&term_id=" + term_id + "'"); button_player.setAttribute("onclick","window.open('https://ke.qq.com/webcourse/index.html#cid=" + cource_id + "&term_id=" + term_id + "')"); button_player.textContent="进入播放页"; button_bar.appendChild(button_player); }
screenshot: