Skip to content
Merged

Dev #84

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
bc27f18
feat: 添加液态玻璃效果选项及相关资源 (#76)
Karis004 Jul 29, 2025
6eac497
chore: bump version to 1.3.0.7 [pre-release]
Karis004 Jul 29, 2025
92fad93
Merge pull request #77 from EZ-HKU/chore/version-bump-25072912
github-actions[bot] Jul 29, 2025
8360494
feat: 优化下载功能,支持文件夹下载
Karis004 Sep 17, 2025
047d6eb
feat: 隐藏考试基准跳转标签,优化用户界面
Karis004 Sep 17, 2025
ce36e20
Merge branch 'dev' into fix/superloadlload
adlsdztony Sep 17, 2025
ea88927
Merge pull request #78 from EZ-HKU/fix/superloadlload
adlsdztony Sep 17, 2025
8494491
chore: bump version to 1.3.1.1 [pre-release]
adlsdztony Sep 17, 2025
8588cdf
Merge pull request #79 from EZ-HKU/chore/version-bump-25091735
github-actions[bot] Sep 17, 2025
8812d1a
feat&chore: 更新manifest.json以添加webRequest权限并引入moodle_pdf_download_rule…
adlsdztony Sep 24, 2025
df2ccce
Merge pull request #80 from EZ-HKU/feat/not-download
adlsdztony Sep 24, 2025
95598e4
chore: bump version to 1.3.1.2 [pre-release]
adlsdztony Sep 24, 2025
ba2c0aa
Merge pull request #81 from EZ-HKU/chore/version-bump-25092452
github-actions[bot] Sep 24, 2025
35b82d6
fix: Optimize the logic for extracting course links and titles in the…
Karis004 Jan 29, 2026
d9052ae
chore: bump version to 1.3.1.3 [pre-release]
Karis004 Jan 29, 2026
8810a82
Merge pull request #83 from EZ-HKU/chore/version-bump-26012944
github-actions[bot] Jan 29, 2026
26d08f4
Merge branch 'main' into dev
adlsdztony Jan 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.vscode/

_metadata/
.DS_Store
Binary file added icons/folder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/noise.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 17 additions & 5 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"manifest_version": 3,
"name": "SuperEZ",
"version": "1.3.1",
"description": "Better online HKU experience with SuperEZ",
"name": "SuperEZ BETA",
"version": "1.3.1.3",
"description": "Better online HKU experience with SuperEZ (THIS EXTENSION IS FOR BETA TESTING)",
"background": {
"service_worker": "scripts/background.js"
},
Expand Down Expand Up @@ -110,13 +110,24 @@
"tabs",
"activeTab",
"cookies",
"downloads"
"downloads",
"webRequest",
"declarativeNetRequest"
],
"host_permissions": [
"https://hkuportal.hku.hk/*",
"https://moodle.hku.hk/*",
"https://booking.lib.hku.hk/*"
],
"declarative_net_request": {
"rule_resources": [
{
"id": "ruleset_1",
"enabled": true,
"path": "rules/moodle_pdf_download_rules.json"
}
]
},
"icons": {
"16": "images/icon16.png",
"32": "images/icon32.png",
Expand All @@ -130,7 +141,8 @@
{
"resources": [
"images/setting.svg",
"icons/*.png"
"icons/*.png",
"images/noise.png"
],
"matches": [
"<all_urls>"
Expand Down
18 changes: 18 additions & 0 deletions rules/moodle_pdf_download_rules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[{
"id": 1,
"priority": 1,
"action": {
"type": "redirect",
"redirect": {
"transform": {
"queryTransform": {
"removeParams": ["forcedownload"]
}
}
}
},
"condition": {
"urlFilter": "https://moodle.hku.hk/pluginfile.php",
"resourceTypes": ["main_frame", "sub_frame", "object", "xmlhttprequest", "stylesheet", "script"]
}
}]
2 changes: 1 addition & 1 deletion scripts/help/jsx/Help.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ window.popup.HelpPopup = async function (custom, inner) {
innerText: "Powered by EZ-HKU with ❤️",
}),
window.elements.Div({
innerText: "v1.3.1",
innerText: "v1.3.1.3",
}),
window.elements.A({
href: "https://github.com/EZ-HKU/SuperEZ/wiki",
Expand Down
10 changes: 5 additions & 5 deletions scripts/moodle/js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,10 @@ function generate() {
my_card_btn.addEventListener("click", () => {
var parent_node =
i.parentNode.parentNode.parentNode.parentNode;
var url = parent_node.querySelector("a").href;
var title = i.parentNode
.querySelector(".sr-only")
.textContent.substring(19);
console.log(i.parentNode.querySelector(".sr-only"));
var a_tag = parent_node.querySelector("a");
var url = a_tag.href;
var title = a_tag.firstElementChild.firstElementChild.textContent;
console.log({ title });
var code = title.substring(0, 8);
var detail = title.substring(9);
chrome.storage.sync.get(["course_code_list"], (data) => {
Expand Down Expand Up @@ -285,6 +284,7 @@ function jumpToExamBase() {

const jumpTab = document.createElement("div");
jumpTab.id = "jump-to-exam-base";
jumpTab.style.display = "none";
jumpTab.style.position = "fixed";
jumpTab.style.left = "50vw";
jumpTab.style.top = "30vh";
Expand Down
30 changes: 30 additions & 0 deletions scripts/navigator/Navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ function Navigator(btns, centerCustom, custom, inner) {
});
})
),
window.elements.Div({
innerHTML: `
<svg style="position:absolute;width:0;height:0">
<filter id="frosted" primitiveUnits="objectBoundingBox">
<feImage id="feImg" href="" x="0" y="0" width="1" height="1" result="map" />
<feGaussianBlur in="SourceGraphic" stdDeviation="0.02" result="blur" />
<feDisplacementMap id="disp" in="blur" in2="map" scale="1" xChannelSelector="R" yChannelSelector="G">
<animate attributeName="scale" to="1.4" dur="0.3s" begin="btn.mouseover" fill="freeze" />
<animate attributeName="scale" to="1" dur="0.3s" begin="btn.mouseout" fill="freeze" />
</feDisplacementMap>
</filter>
</svg>
`
})
]
);
}
Expand Down Expand Up @@ -135,6 +149,22 @@ function init() {

var navigator = Navigator(btns, { innerText: "🚀" });
document.documentElement.appendChild(navigator);

chrome.storage.sync.get("LiquidGlass", function (i) {
if (i.LiquidGlass) {
document.getElementById("feImg").setAttribute("href", chrome.runtime.getURL("images/noise.png"));
document.getElementById("ez-navigator-center").classList.add("liquid-glass");
document.querySelectorAll(".ez-inner").forEach(function (el) {
el.classList.add("liquid-glass");
});
} else {
document.getElementById("ez-navigator-center").classList.remove("liquid-glass");
document.querySelectorAll(".ez-inner").forEach(function (el) {
el.classList.remove("liquid-glass");
});
}
});

}

init();
Expand Down
40 changes: 40 additions & 0 deletions scripts/setting/jsx/Setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,45 @@ async function ExamBaseButton(custom, inner) {
])
}

async function LiquidGlass(custom, inner) {
return window.elements.Div({
style: {
textAlign: "left",
marginLeft: "15px",
},
}, [
window.elements.Input(
{
type: "checkbox",
id: "ez-liquid-glass-checkbox",
style: {
width: "20px",
height: "20px",
verticalAlign: "middle",
},
checked: (await window.utils.getStorage('LiquidGlass')).LiquidGlass || false,
onClick: async function (e) {
let isChecked = e.target.checked;
await chrome.storage.sync.set({
LiquidGlass: isChecked,
});

},
}, []
),
window.elements.Label({
htmlFor: "ez-liquid-glass-checkbox",
innerText: "Liquid Glass",
style: {
fontSize: "15px",
color: "#555555",
verticalAlign: "middle",
marginLeft: "10px",
marginBottom: "0",
},
}),
])
}

function SettingBlock(name, element) {
return window.elements.Div({
Expand Down Expand Up @@ -276,6 +315,7 @@ window.popup.SettingPopup = async function SettingPopup(custom, inner) {
SettingBlock("Set User", window.popup.SetUserForm()),
SettingBlock("Quick Logout", LogoutButton()),
SettingBlock("Exam Base", await ExamBaseButton()),
SettingBlock("UI", await LiquidGlass()),
]
)
)
Expand Down
13 changes: 10 additions & 3 deletions scripts/superload/background.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
// background.js
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
if (message.action === 'downloadFile') {
// https://moodle.hku.hk/mod/folder/download_folder.php?id=3764675
// https://moodle.hku.hk/mod/folder/view.php?id=3764676
if (message.url.includes('/mod/folder/')) {
message.url = message.url.replace('/view.php?id=', '/download_folder.php?id=');
}
chrome.downloads.download({
url: message.url,
filename: `SuperLoad/${message.address}/${message.filename}.pdf`,
filename: `SuperLoad/${message.address}/${message.filename}.zip`,
saveAs: message.saveAs,
conflictAction: message.conflictAction
}, (downloadId) => {
Expand All @@ -15,10 +20,12 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
});
} else if (message.action === 'downloadFiles') {
message.downloadFiles.forEach(file => {

if (file.url.includes('/mod/folder/')) {
file.url = file.url.replace('/view.php?id=', '/download_folder.php?id=');
}
chrome.downloads.download({
url: file.url,
filename: `SuperLoad/${file.address}/${file.filename}.pdf`,
filename: `SuperLoad/${file.address}/${file.filename}.zip`,
saveAs: message.saveAs,
conflictAction: message.conflictAction
}, (downloadId) => {
Expand Down
9 changes: 6 additions & 3 deletions scripts/superload/jsx/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ function findPDFLinks() {
let fileLinks = [];
let links = document.getElementsByTagName('a');
// filter links
links = Array.from(links).filter(link => link.href && link.href.includes('https://moodle.hku.hk/mod/resource/') && link.classList.contains('aalink'));
links = Array.from(links).filter(link => link.href && link.href.includes('https://moodle.hku.hk/mod/') && link.classList.contains('aalink'));
for (let link of links) {
if (link.href &&
link.href.includes('https://moodle.hku.hk/mod/resource/')) {
(link.href.includes('https://moodle.hku.hk/mod/resource/')||
link.href.includes('https://moodle.hku.hk/mod/folder/'))){
let fileType = 'unknown';
let iconSrc = '';

Expand All @@ -20,6 +21,8 @@ function findPDFLinks() {
const match = iconSrc.match(/\/f\/([^?]+)/);
if (match && match[1]) {
fileType = match[1].toLowerCase();
} else {
fileType = 'folder';
}
}
}
Expand All @@ -38,7 +41,7 @@ function findPDFLinks() {

window.popup.SuperLoadPopup = async function () {
let fileLinks = findPDFLinks();
let posibleFileTypes = ['pdf', 'file', 'powerpoint', 'spreadsheet', 'archive', 'document', 'video', 'image'];
let posibleFileTypes = ['pdf', 'file', 'powerpoint', 'spreadsheet', 'archive', 'document', 'video', 'image', 'folder'];
let downloadedFileIDs = (await window.utils.getStorageLocal('downloadedFileIDs')).downloadedFileIDs || [];
return (
window.elements.Div({
Expand Down
5 changes: 5 additions & 0 deletions styles/navigator.css
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,8 @@
background-color: #e4eafa;
color: #000000;
}

.liquid-glass {
backdrop-filter: url(#frosted) !important;
background: rgba(255, 255, 255, .08) !important;
}
Loading