Skip to content

Commit

Permalink
Merge pull request #6 from Boomaa23/master
Browse files Browse the repository at this point in the history
Update for FA22 and Manifest V3
  • Loading branch information
ziyaointl authored Aug 5, 2022
2 parents 1e8f691 + e624a96 commit 945d3e6
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you want to install from source, download the repo as a zip file. Go to chrom

### Usage

1. Go to CalCentral, My Academics. Select Organize and preview your upcoming semester.
1. Go to CalCentral, My Academics. Select Schedule Planner.

![docs/usage-1.png](docs/usage-1.png)

Expand Down
Binary file modified docs/usage-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 11 additions & 7 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "Berkeley Schedule Exporter",
"version": "1.2.2",
"version": "1.2.3",
"description": "Export your Berkeley class schedule!",
"manifest_version": 2,
"page_action": {
"manifest_version": 3,
"action": {
"default_icon": {
"16": "icons/icon-16.png",
"32": "icons/icon-32.png",
Expand All @@ -16,10 +16,14 @@
"48": "icons/icon-48.png",
"128": "icons/icon-128.png"
},
"permissions": ["declarativeContent", "activeTab"],
"permissions": ["declarativeContent", "activeTab", "scripting"],
"background": {
"scripts": ["src/background.js"],
"persistent": false
"service_worker": "src/background.js"
},
"web_accessible_resources": ["src/export.js", "src/icsjs/ics.deps.min.js"]
"web_accessible_resources": [
{
"resources": ["src/export.js", "src/icsjs/ics.deps.min.js"],
"matches": ["https://berkeley.collegescheduler.com/*"]
}
]
}
7 changes: 4 additions & 3 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ chrome.runtime.onInstalled.addListener(function() {
});
});

chrome.pageAction.onClicked.addListener(function(tab) {
chrome.tabs.executeScript({
file: 'src/main.js'
chrome.action.onClicked.addListener(function(tab) {
chrome.scripting.executeScript({
target: {tabId: tab.id, allFrames: true},
files: ['src/main.js']
});
});
4 changes: 4 additions & 0 deletions src/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ var semesters = {
startDate: "05/23/2022",
endDate: "08/12/2022",
},
"2022 Fall": {
startDate: "08/24/2022",
endDate: "12/09/2022"
}
}

Date.prototype.addDays = function(days) {
Expand Down
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function injectScript(script) {
var s = document.createElement('script');
s.src = chrome.extension.getURL(script);
s.src = chrome.runtime.getURL(script);
s.onload = function() {
this.remove();
};
Expand Down

0 comments on commit 945d3e6

Please sign in to comment.