Skip to content

Commit

Permalink
docs: 修复油猴脚本 @GM_addElement 兼容问题,修改注释
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed Mar 25, 2022
1 parent 659955b commit f0c5790
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

> `优点`:简单
> `缺点`:不方便,每次都需要重新输入代码
> `缺点`:不方便,每次都需要重新输入代码,有些功能不能使用,例如倍速破解。
1.在任意的 [`网课平台`](#网课平台) 页面,打开 `开发者工具`,方法如下。

Expand Down Expand Up @@ -84,8 +84,8 @@ var resource = (url) => fetch(url).then((res) => res.text());
// @match *://*.zhihuishu.com/*
// @require https://cdn.jsdelivr.net/npm/ocsjs@latest/dist/js/index.min.js
// @resource OCS_STYLE https://cdn.jsdelivr.net/npm/ocsjs@latest/dist/style/common.css
// @resource BootstrapIcons https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css
// @grant unsafeWindow
// @grant GM_addElement
// @grant GM_getResourceText
// @run-at document-start
// ==/UserScript==
Expand All @@ -99,10 +99,9 @@ var resource = (url) => fetch(url).then((res) => res.text());
unsafeWindow.OCS = OCS;

// 加载 bootstrap icons 图标样式
GM_addElement("link", {
rel: "stylesheet",
href: "https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css",
});
const style = document.createElement("style");
style.innerText = GM_getResourceText("BootstrapIcons");
document.head.appendChild(style);

OCS.start({
// 加载样式
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface AnswererWrapper {
*
* 并且返回一个数组 : `[题目, 答案]`
*
* 或者二维数据 : `[[题目1, 答案1],[题目2, 答案2, ...]`
* 或者二维数据 : `[[题目1, 答案1],[题目2, 答案2], ...`
*
* 如果搜不到则返回 undefined
*
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/src/browser/cx/panels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function createCXStudySettingPanel(): DefineComponent {
ref: "setting.cx.video.playbackRate",
type: "number",
attrs: {
title: "高倍速可能导致封号或者频繁验证码,请谨慎设置。",
title: "高倍速可能导致封号或者频繁验证码\n超星后台可以看到学习时长\n请谨慎设置。",
value: settings.playbackRate.toString(),
min: "1",
max: "16",
Expand Down
3 changes: 3 additions & 0 deletions packages/scripts/src/browser/cx/study.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ function searchTask(setting: ScriptSettings["cx"]["video"]): Array<() => Promise
frame.contentDocument || document
);

// @ts-ignore
// console.log("data", { frame }, unsafeWindow.attachments[0]);

return media
? mediaTask(setting, media as any)
: ppt
Expand Down

0 comments on commit f0c5790

Please sign in to comment.