Skip to content

Commit ffa5e2e

Browse files
committed
Initial commit
0 parents  commit ffa5e2e

9 files changed

Lines changed: 319 additions & 0 deletions

File tree

StudyChromeApp/1.png

2.46 KB
Loading

StudyChromeApp/jquery-1.4.3.min.js

Lines changed: 166 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

StudyChromeApp/manifest.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "自动学习",
3+
"manifest_version": 2,
4+
"version": "1.0",
5+
"description":"自动学习",
6+
"browser_action": {
7+
"default_icon": "1.png",
8+
"default_popup": "popup.html"
9+
},
10+
"content_scripts": [
11+
{
12+
"matches": ["http://learning.uestcedu.com/*","http://learning.uestcedu.com/*"],
13+
"js": ["jquery-1.4.3.min.js",
14+
15+
"script.js"],
16+
"run_at": "document_start"
17+
}
18+
],
19+
"permissions": ["*://*/*","tabs"]
20+
}

StudyChromeApp/popup.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+

2+
<style type="text/css">
3+
*{margin:0;padding:0;}
4+
body{color:#333;overflow: hidden;margin: 0px;padding:5px;background: white;font-size:12px;}
5+
img{margin:0 4px;}
6+
#addItemDiv{color:#ccc;}
7+
#taskItemList{ width:120px;}
8+
.hide{display:none;}
9+
.show{display:block;}
10+
.taskItem{cursor:pointer;}
11+
input{width:100%;}
12+
</style>
13+
<div id="taskItemList">
14+
<div id="taskItem" class="taskItem" onClick="autoStart()">
15+
<label class="on"></label><span class="taskTitle">开启自动学习</span>
16+
</div>
17+
</div>

StudyChromeApp/script.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+

2+
chrome.tabs.onUpdated.addListener(function(tabId,changeInfo,tab){
3+
alert(tab.url);
4+
})
5+
6+
7+
function autoStart(){
8+
9+
alert(" dsad ");
10+
}
11+
$(function(){
12+
13+
14+
15+
16+
$("#taskItem").click(function(){
17+
18+
alert();
19+
});
20+
21+
22+
23+
})
24+
console.log($("#tdRemark").text());
25+
26+
if($("#tdRemark").text().indexOf("已经学习完毕") != -1){
27+
alert("学习完成了的哈@");
28+
}

StudyChromeApp/study.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function(){
2+
3+
if($("#tdRemark").text().indexOf("已经学习完毕") != -1){
4+
alert("学习完成了的哈@");
5+
}
6+
7+
8+
9+
10+
11+
12+
}();

study.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Title</title>
6+
</head>
7+
<body>
8+
9+
10+
<iframe id="iframe" name="Iframe" width="900" height="500" src="http://learning.uestcedu.com/learning3/console/?urlto=http%3a%2f%2flearning%2euestcedu%2ecom%2flearning3%2fcourse%2fcourse_learning%2ejsp%3fcourse_id%3d2669%26course_name%3d&0.09434334261620991" frameborder="0"></iframe>
11+
</body>
12+
13+
14+
<a href="#" click="autoStart()">开始自动学习</a>
15+
<script>
16+
function autoStart(){
17+
window.frames["Iframe"].document.location = "javascript:alert()"
18+
19+
}
20+
21+
22+
</script>
23+
</html>

study.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* 该自动学习脚本仅用于学习研究,未经作者同意不得用于商业用途。
3+
*
4+
* @author marker
5+
* @date 2017-03-05
6+
* @type {number}
7+
*/
8+
9+
/* 全局变量配置 */
10+
var STUDY_DELAY_TIME = 1; // 延时启动。单位:秒
11+
var STUDY_PERIOD_TIME = 5; // 下一章节周期 单位:分钟
12+
13+
14+
15+
/**
16+
* 自动学习函数
17+
*/
18+
var myInterval;
19+
function study(){
20+
console.log("学习完成,准备下一章节...")
21+
console.log(window.JQUERY_CUSTERM );
22+
// 10秒后开始
23+
if(window.JQUERY_CUSTERM ("#btnNext")){
24+
console.log("进入下一章节...")
25+
window.JQUERY_CUSTERM("#btnNext").click();
26+
}else{
27+
console.log(window.JQUERY_CUSTERM ("#btnNext"));
28+
console.error("没有找到【下一个】按钮");
29+
console.log("正在关闭周期循环管理器!");
30+
clearInterval(myInterval);
31+
}
32+
};
33+
function startRun(){
34+
console.log("【下一个】按钮获取焦点")
35+
window.JQUERY_CUSTERM("#btnNext", window.frames['w_main']).focus();
36+
myInterval = setInterval(study, STUDY_PERIOD_TIME * 1000);
37+
}
38+
window.JQUERY_CUSTERM = $;
39+
console.log("自动学习脚本启动...")
40+
setTimeout(startRun, STUDY_DELAY_TIME * 1000);

study.min.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* 该自动学习脚本仅用于学习研究,未经作者同意不得用于商业用途。
3+
*
4+
* @author marker
5+
* @date 2017-03-05
6+
* @type {number}
7+
*/
8+
9+
/* 全局变量配置 */
10+
var STUDY_DELAY_TIME = 1; // 延时启动。单位:秒
11+
var STUDY_PERIOD_TIME = 5; // 下一章节周期 单位:秒
12+
13+
var myInterval;function study(){console.log("学习完成,准备下一章节...");console.log(window.JQUERY_CUSTERM);if(window.JQUERY_CUSTERM("#btnNext")){console.log("进入下一章节...");window.JQUERY_CUSTERM("#btnNext").click()}else{console.log(window.JQUERY_CUSTERM("#btnNext"));console.error("没有找到【下一个】按钮");console.log("正在关闭周期循环管理器!");clearInterval(myInterval)}}function startRun(){myInterval=setInterval(study,STUDY_PERIOD_TIME*1000)}window.JQUERY_CUSTERM=$;console.log("自动学习脚本启动...");setTimeout(startRun,STUDY_DELAY_TIME*1000);

0 commit comments

Comments
 (0)