Skip to content

Commit 7569aa4

Browse files
authored
Merge pull request #19 from sauravhathi/dev
popup screen ✅
2 parents 7720c3a + 5caf789 commit 7569aa4

File tree

8 files changed

+74
-27
lines changed

8 files changed

+74
-27
lines changed

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
rdr.js
22
scripts/content.js
3-
panel.css
4-
panel.html
5-
panel.js
6-
temp.manifest.json
7-
temp.background.js
3+
popup/popup-o.js

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Coursera Automation Extension
2-
![Version](https://img.shields.io/badge/version-1.4.0-blue)
2+
![Version](https://img.shields.io/badge/version-2.4.0-blue)
33
![License](https://img.shields.io/badge/license-MIT-green)
44
![Platform](https://img.shields.io/badge/platform-Chrome-blue)
55

@@ -55,7 +55,7 @@ Only for `Quiz Automation`.
5555
## How to use
5656

5757
1. Open your Coursera course.
58-
2. Press Alt + W to access the extension.
58+
2. Click on the Extension icon.
5959
3. Choose the task you want to automate.
6060
4. Sit back while the Extension completes the task.
6161

@@ -84,7 +84,7 @@ Extension will automatically get the solutions and mark the correct options.
8484

8585
## Keyboard Shortcuts
8686

87-
- `Alt + W` or `Ctrl + Shift + W`: Open the Extension
87+
- `Alt + W` or `Alt + B`: Toggle the Extension
8888
- `Alt + X` or `Ctrl + Shift + X`: Activate the account
8989
- `Alt + Z` or `Ctrl + Shift + Z`: Refresh the answers
9090

manifest.json

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
{
22
"manifest_version": 3,
33
"name": "Coursera Automation Extension",
4-
"version": "1.4.0",
4+
"version": "2.4.0",
55
"author": "Saurav Hathi",
66
"version_name": "Release Version",
77
"description": "This extension is used to attempt the coursera course quiz, video, reading material, ungraded plugin and discussion automatically.",
8-
"permissions": [
9-
"storage",
10-
"activeTab",
11-
"scripting",
12-
"tabs"
13-
],
8+
"permissions": ["storage", "activeTab", "scripting", "tabs", "commands"],
149
"background": {
1510
"service_worker": "/scripts/background.js"
1611
},
@@ -20,25 +15,38 @@
2015
"48": "images/3.png",
2116
"128": "images/4.png"
2217
},
18+
"action": {
19+
"default_popup": "/popup/popup.html"
20+
},
2321
"content_scripts": [
2422
{
2523
"run_at": "document_start",
26-
"matches": [
27-
"*://*.coursera.org/*"
28-
],
29-
"js": [
30-
"/scripts/minifyContent.js"
31-
],
32-
"css": [
33-
"/styles/content.css"
34-
]
24+
"matches": ["*://*.coursera.org/*"],
25+
"js": ["/scripts/minifyContent.js"],
26+
"css": ["/styles/content.css"]
3527
}
3628
],
29+
"commands": {
30+
"open_popup_1": {
31+
"suggested_key": {
32+
"default": "Alt+B",
33+
"mac": "Command+B"
34+
},
35+
"description": "Open the Course Automation Extension popup window with Alt+B"
36+
},
37+
"open_popup_2": {
38+
"suggested_key": {
39+
"default": "Alt+W",
40+
"mac": "Command+W"
41+
},
42+
"description": "Open the Course Automation Extension popup window with Alt+W"
43+
}
44+
},
3745
"web_accessible_resources": [
3846
{
3947
"resources": ["minifyrdr.js"],
4048
"matches": ["*://*.coursera.org/*"]
4149
}
4250
],
43-
"host_permissions": ["<all_urls>"]
44-
}
51+
"host_permissions": ["*://*.coursera.org/*"]
52+
}

popup/popup.css

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

popup/popup.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Coursera Automation Extension</title>
8+
<script src="popup.js"></script>
9+
<link rel="stylesheet" href="popup.css">
10+
</head>
11+
12+
<body>
13+
<div id="courseraModel">
14+
<div id="courseraModelContent">
15+
<h1 id="courseraModelTitle">
16+
Coursera Automation Extension
17+
</h1>
18+
<div id="courseraModelGrid"></div>
19+
</div>
20+
<footer id="footer">
21+
<svg stroke="#ffffff" fill="#ffffff" stroke-width="0" viewBox="0 0 384 512" height="1em" width="1em"
22+
xmlns="http://www.w3.org/2000/svg">
23+
<path
24+
d="M384 144c0-44.2-35.8-80-80-80s-80 35.8-80 80c0 36.4 24.3 67.1 57.5 76.8-.6 16.1-4.2 28.5-11 36.9-15.4 19.2-49.3 22.4-85.2 25.7-28.2 2.6-57.4 5.4-81.3 16.9v-144c32.5-10.2 56-40.5 56-76.3 0-44.2-35.8-80-80-80S0 35.8 0 80c0 35.8 23.5 66.1 56 76.3v199.3C23.5 365.9 0 396.2 0 432c0 44.2 35.8 80 80 80s80-35.8 80-80c0-34-21.2-63.1-51.2-74.6 3.1-5.2 7.8-9.8 14.9-13.4 16.2-8.2 40.4-10.4 66.1-12.8 42.2-3.9 90-8.4 118.2-43.4 14-17.4 21.1-39.8 21.6-67.9 31.6-10.8 54.4-40.7 54.4-75.9zM80 64c8.8 0 16 7.2 16 16s-7.2 16-16 16-16-7.2-16-16 7.2-16 16-16zm0 384c-8.8 0-16-7.2-16-16s7.2-16 16-16 16 7.2 16 16-7.2 16-16 16zm224-320c8.8 0 16 7.2 16 16s-7.2 16-16 16-16-7.2-16-16 7.2-16 16-16z">
25+
</path>
26+
</svg>
27+
<span id="author">
28+
Saurav Hathi
29+
</span>
30+
</footer>
31+
</div>
32+
33+
</body>
34+
35+
</html>

popup/popup.js

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

scripts/background.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@ chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
1616
if (chrome.runtime.lastError) { } else { }
1717
});
1818
}
19+
});
20+
21+
chrome.commands.onCommand.addListener((command) => {
22+
if (command === "open_popup_1" || command === "open_popup_2") {
23+
chrome.action.openPopup();
24+
}
1925
});

scripts/minifyContent.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)