Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ EduPage, open a GitHub issue or report it on [Discord](https://discord.gg/eNZXHe
- **Export to .ics** — download the current week or the whole half-year as a
standard calendar file, importable into calendar apps.

### Experimental

Experimental settings include a **Test Stay Active Mode** button below the Stay Active
master switch. It opens https://test.nop.wtf in a new tab. The reload action reloads both
EduPage and test.nop.wtf tabs.

### Keyboard shortcuts

Some features can be bound on the browser's extension-shortcuts page.
Expand Down Expand Up @@ -131,7 +137,7 @@ Edupage Extras requests:
Edupage pages, reads timetable/attendance data already present in Edupage,
and lets the settings UI find and reload open Edupage tabs (no separate
`tabs` permission is requested).
- Optional `https://edublurtesting.ct.ws/*` access is requested only after you choose to open the testing site from the experimental settings.
- `https://test.nop.wtf/*` host access - runs the experimental activity shields on the testing site and lets settings reload its tabs.
- `https://raw.githubusercontent.com/JustAlex0000/Edupage-Extras/*` host access -
reads the public project manifest for update checks.
- Optional access to `localhost`, `127.0.0.1`, `integrate.api.nvidia.com`, or
Expand Down
12 changes: 5 additions & 7 deletions _locales/cs/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,12 @@
},

"experimentalHeading": { "message": "Experimentální" },
"experimentalSubtitle": { "message": "Otestujte ochranu aktivity a viditelnosti na stránkách Edupage." },
"openTestingSite": { "message": "Otevřít testovací stránku režimu zůstat aktivní" },
"testingSitePermissionUnavailable": { "message": "Tento prohlížeč nemůže udělit přístup k testovací stránce." },
"testingSitePermissionDenied": { "message": "Přístup k testovací stránce nebyl udělen." },
"samHeading": { "message": "Režim Zůstat aktivní" },
"samDesc": { "message": "Ovládá, jak Edupage vidí aktivitu karty, zaměření, pohyb myši a akce schránky. Změny se projeví okamžitě, ale nejčistší start získáte opětovným načtením otevřených karet Edupage." },
"samMaster": { "message": "Režim Zůstat aktivní (hlavní vypínač)" },
"samMasterDesc": { "message": "Zapněte nebo vypněte najednou celou sadu funkcí Zůstat aktivní pro stránky Edupage." },
"samTestShields": { "message": "Otestovat režim Zůstat aktivní" },
"samTestShieldsDesc": { "message": "Otevře stránku pro testování režimu Zůstat aktivní na nové kartě." },
"toggleSam": { "message": "Přepnout režim Zůstat aktivní" },
"sectVisibility": { "message": "Viditelnost a zaměření" },
"keepVisible": { "message": "Udržovat kartu označenou jako viditelnou" },
Expand Down Expand Up @@ -400,11 +398,11 @@
"sectMaintenance": { "message": "Údržba" },
"maintenanceDesc": { "message": "Obnovení obnoví experimentální výchozí hodnoty a ponechá režim Zůstat aktivní vypnutý." },
"resetSam": { "message": "Obnovit režim Zůstat aktivní" },
"reloadTabs": { "message": "Znovu načíst karty Edupage" },
"reloadTabs": { "message": "Znovu načíst karty Edupage a testu" },
"savedStatus": { "message": "Uloženo" },
"resetStatus": { "message": "Obnoveno" },
"tabsReloaded": { "message": "Karty Edupage znovu načteny" },
"noTabsOpen": { "message": "Žádné otevřené karty Edupage" },
"tabsReloaded": { "message": "Karty Edupage a testu znovu načteny" },
"noTabsOpen": { "message": "Žádné otevřené karty Edupage ani testu" },
"shortcutSettingsOpened": { "message": "Nastavení zkratek otevřeno" },
"shortcutSettingsFirefoxHint": { "message": "Firefox správuje zkratky na stránce about:addons — klikněte tam na ikonu ozubeného kola a vyberte \"Správa zkratek doplňků\"." },
"shortcutSettingsFailed": { "message": "Nepodařilo se otevřít nastavení zkratek" },
Expand Down
12 changes: 5 additions & 7 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,12 @@
},

"experimentalHeading": { "message": "Experimental" },
"experimentalSubtitle": { "message": "Experimental settings that shouldn't be in the main settings." },
"openTestingSite": { "message": "Open the Stay Active testing site" },
"testingSitePermissionUnavailable": { "message": "This browser cannot grant access to the testing site." },
"testingSitePermissionDenied": { "message": "Access to the testing site was not granted." },
"samHeading": { "message": "Stay Active Mode" },
"samDesc": { "message": "Controls how Edupage sees tab activity, focus, mouse movement, and clipboard actions. Changes apply live, but reloading open Edupage is recommended." },
"samMaster": { "message": "Stay Active Mode (Master Switch)" },
"samMasterDesc": { "message": "Toggle the full Stay Active feature set at once." },
"samTestShields": { "message": "Test Stay Active Mode" },
"samTestShieldsDesc": { "message": "Open the Stay Active Mode testing page in a new tab." },
"toggleSam": { "message": "Toggle Stay Active Mode" },
"sectVisibility": { "message": "Visibility & Focus" },
"keepVisible": { "message": "Keep Tab Marked Visible" },
Expand Down Expand Up @@ -400,11 +398,11 @@
"sectMaintenance": { "message": "Maintenance" },
"maintenanceDesc": { "message": "Reset restores the experimental defaults and keeps Stay Active Mode turned off." },
"resetSam": { "message": "Reset Stay Active Mode" },
"reloadTabs": { "message": "Reload Edupage Tabs" },
"reloadTabs": { "message": "Reload Edupage and Test Tabs" },
"savedStatus": { "message": "Saved" },
"resetStatus": { "message": "Reset" },
"tabsReloaded": { "message": "Edupage tabs reloaded" },
"noTabsOpen": { "message": "No Edupage tabs open" },
"tabsReloaded": { "message": "Edupage and test tabs reloaded" },
"noTabsOpen": { "message": "No Edupage or test tabs open" },
"shortcutSettingsOpened": { "message": "Shortcut settings opened" },
"shortcutSettingsFirefoxHint": { "message": "Firefox manages shortcuts on the about:addons page — click the gear icon there and choose \"Manage Extension Shortcuts\"." },
"shortcutSettingsFailed": { "message": "Could not open shortcut settings" },
Expand Down
12 changes: 5 additions & 7 deletions _locales/sk/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,12 @@
},

"experimentalHeading": { "message": "Experimentálne" },
"experimentalSubtitle": { "message": "Otestujte ochranu aktivity a viditeľnosti na stránkach Edupage." },
"openTestingSite": { "message": "Otvoriť testovaciu stránku režimu zostať aktívny" },
"testingSitePermissionUnavailable": { "message": "Tento prehliadač nemôže povoliť prístup k testovacej stránke." },
"testingSitePermissionDenied": { "message": "Prístup k testovacej stránke nebol povolený." },
"samHeading": { "message": "Režim Zostať aktívny" },
"samDesc": { "message": "Ovláda, ako Edupage vidí aktivitu karty, zameranie, pohyb myši a akcie schránky. Zmeny sa prejavia okamžite, ale najčistejší štart získate znovu načítaním otvorených kariet Edupage." },
"samMaster": { "message": "Režim Zostať aktívny (hlavný vypínač)" },
"samMasterDesc": { "message": "Zapnite alebo vypnite naraz celú sadu funkcií Zostať aktívny pre stránky Edupage." },
"samTestShields": { "message": "Otestovať režim Zostať aktívny" },
"samTestShieldsDesc": { "message": "Otvorí stránku na testovanie režimu Zostať aktívny v novej karte." },
"toggleSam": { "message": "Prepnúť režim Zostať aktívny" },
"sectVisibility": { "message": "Viditeľnosť a zameranie" },
"keepVisible": { "message": "Udržiavať kartu označenú ako viditeľnú" },
Expand Down Expand Up @@ -400,11 +398,11 @@
"sectMaintenance": { "message": "Údržba" },
"maintenanceDesc": { "message": "Obnovenie obnoví experimentálne predvolené hodnoty a ponechá režim Zostať aktívny vypnutý." },
"resetSam": { "message": "Obnoviť režim Zostať aktívny" },
"reloadTabs": { "message": "Znovu načítať karty Edupage" },
"reloadTabs": { "message": "Znovu načítať karty Edupage a testu" },
"savedStatus": { "message": "Uložené" },
"resetStatus": { "message": "Obnovené" },
"tabsReloaded": { "message": "Karty Edupage znovu načítané" },
"noTabsOpen": { "message": "Žiadne otvorené karty Edupage" },
"tabsReloaded": { "message": "Karty Edupage a testu znovu načítané" },
"noTabsOpen": { "message": "Žiadne otvorené karty Edupage ani testu" },
"shortcutSettingsOpened": { "message": "Nastavenia skratiek otvorené" },
"shortcutSettingsFirefoxHint": { "message": "Firefox správuje skratky na stránke about:addons — kliknite tam na ikonu ozubeného kolieska a vyberte \"Správa skratiek doplnkov\"." },
"shortcutSettingsFailed": { "message": "Nepodarilo sa otvoriť nastavenia skratiek" },
Expand Down
20 changes: 10 additions & 10 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"http://localhost/*",
"https://generativelanguage.googleapis.com/*",
"https://integrate.api.nvidia.com/*",
"https://openrouter.ai/*",
"https://edublurtesting.ct.ws/*"
"https://openrouter.ai/*"
],
"host_permissions": [
"https://test.nop.wtf/*",
"https://*.edupage.org/*",
"https://raw.githubusercontent.com/JustAlex0000/Edupage-Extras/*"
],
Expand Down Expand Up @@ -99,26 +99,26 @@
"match_about_blank": true
},
{
"matches": [
"https://*.edupage.org/*",
"https://edublurtesting.ct.ws/*"
],
"js": ["scripts/activity-shield-main.js"],
"matches": ["https://*.edupage.org/*"],
"js": ["scripts/etest-answer-bridge.js"],
"run_at": "document_start",
"all_frames": true,
"match_about_blank": true,
"world": "MAIN"
},
{
"matches": ["https://*.edupage.org/*"],
"js": ["scripts/etest-answer-bridge.js"],
"matches": [
"https://*.edupage.org/*",
"https://test.nop.wtf/*"
],
"js": ["scripts/activity-shield-main.js"],
"run_at": "document_start",
"all_frames": true,
"match_about_blank": true,
"world": "MAIN"
},
{
"matches": ["https://edublurtesting.ct.ws/*"],
"matches": ["https://test.nop.wtf/*"],
"js": ["scripts/activity-shield-bridge.js"],
"run_at": "document_start",
"all_frames": true,
Expand Down
11 changes: 8 additions & 3 deletions menu/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -684,8 +684,6 @@ <h3 data-i18n="reportProblem">Report a Problem</h3>
<section class="setting-group settings-experimental-section" id="panel-experimental" aria-labelledby="experimental-heading" hidden>
<div id="ExperimentalContent" hidden>
<h2 id="experimental-heading" data-i18n="experimentalHeading">Experimental</h2>
<p class="setting-group-subtitle" data-i18n="experimentalSubtitle">Test activity and visibility protections on Edupage pages.</p>
<p class="setting-group-subtitle"><button class="inline-link inline-link-button" id="OpenTestingSiteButton" type="button" data-i18n="openTestingSite">Open the testing website</button></p>

<div class="section-heading">
<h3 id="ai-heading" data-i18n="aiHeading">AI</h3>
Expand Down Expand Up @@ -910,6 +908,13 @@ <h3 data-i18n="samMaster">Stay Active Mode (Master Switch)</h3>
</label>
</div>
</div>
<div class="setting-row">
<div>
<h3 data-i18n="samTestShields">Test Stay Active Mode</h3>
<p data-i18n="samTestShieldsDesc">Open the Stay Active Mode testing page in a new tab.</p>
</div>
<a class="secondary-button" id="ee-test-shields" href="https://test.nop.wtf" target="_blank" rel="noopener noreferrer" data-i18n="samTestShields">Test Stay Active Mode</a>
</div>
</div>

<div class="section-heading">
Expand Down Expand Up @@ -1134,7 +1139,7 @@ <h3 id="maintenance-heading" data-i18n="sectMaintenance">Maintenance</h3>
</div>
<div class="actions-row">
<button class="secondary-button" id="ResetActivityShieldButton" type="button" data-i18n="resetSam">Reset Stay Active Mode</button>
<button class="secondary-button" id="ReloadEdupageTabsButton" type="button" data-i18n="reloadTabs">Reload Edupage Tabs</button>
<button class="secondary-button" id="ReloadEdupageTabsButton" type="button" data-i18n="reloadTabs">Reload Edupage and Test Tabs</button>
<span class="save-status" id="ExperimentalSaveStatus" role="status"></span>
</div>
</div>
Expand Down
23 changes: 1 addition & 22 deletions menu/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const updateStatusText = document.getElementById("UpdateStatusText");
const experimentalContent = document.getElementById("ExperimentalContent");
const experimentalConfirmContinue = document.getElementById("ExperimentalConfirmContinue");
const experimentalShortcutSettingsButton = document.getElementById("ExperimentalShortcutSettingsButton");
const openTestingSiteButton = document.getElementById("OpenTestingSiteButton");
const activityShieldShortcutStatus = document.getElementById("ActivityShieldShortcutStatus");
const resetActivityShieldButton = document.getElementById("ResetActivityShieldButton");
const reloadEdupageTabsButton = document.getElementById("ReloadEdupageTabsButton");
Expand Down Expand Up @@ -159,8 +158,6 @@ const AI_DEFAULT_ENDPOINTS = {
lmstudio: "http://127.0.0.1:1234",
};
const AI_CLOUD_PROVIDERS = new Set(["nvidia", "openrouter", "gemini"]);
const TESTING_SITE_URL = "https://edublurtesting.ct.ws/";
const TESTING_SITE_PERMISSION = "https://edublurtesting.ct.ws/*";
const activityShieldSettings = [
["ActivityShieldEnabled", "eeActivityShieldEnabled"],
["ActivityVisibilityState", "eeActivityShieldVisibilityState"],
Expand Down Expand Up @@ -1121,24 +1118,6 @@ function requestAiHostPermission(pattern) {
});
}

openTestingSiteButton?.addEventListener("click", () => {
openTestingSiteButton.disabled = true;
if (!chrome.permissions?.request) {
setExperimentalStatus(t("testingSitePermissionUnavailable"), true);
openTestingSiteButton.disabled = false;
return;
}
chrome.permissions.request({ origins: [TESTING_SITE_PERMISSION] }, (granted) => {
const error = chrome.runtime.lastError;
openTestingSiteButton.disabled = false;
if (error || !granted) {
setExperimentalStatus(t("testingSitePermissionDenied"), true);
return;
}
chrome.tabs.create({ url: TESTING_SITE_URL });
});
});

function updateActivityShieldDependentControls() {
const enabled = document.getElementById("ActivityShieldEnabled")?.checked === true;
activityShieldControlledSettings.forEach(([elementId]) => {
Expand Down Expand Up @@ -1182,7 +1161,7 @@ if (resetActivityShieldButton) {

if (reloadEdupageTabsButton) {
reloadEdupageTabsButton.addEventListener("click", () => {
chrome.tabs.query({ url: "https://*.edupage.org/*" }, (tabs) => {
chrome.tabs.query({ url: ["https://*.edupage.org/*", "https://test.nop.wtf/*"] }, (tabs) => {
tabs.forEach((tab) => {
if (tab.id) chrome.tabs.reload(tab.id);
});
Expand Down
3 changes: 1 addition & 2 deletions tests/repository-quality.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ test("optional hosts are narrowly scoped to explicit AI and test-site actions",
"https://generativelanguage.googleapis.com/*",
"https://integrate.api.nvidia.com/*",
"https://openrouter.ai/*",
"https://edublurtesting.ct.ws/*",
].sort());
assert.ok(!manifest.host_permissions.includes("https://integrate.api.nvidia.com/*"));
assert.ok(!manifest.host_permissions.includes("https://generativelanguage.googleapis.com/*"));
assert.ok(!manifest.host_permissions.includes("https://openrouter.ai/*"));
assert.ok(!manifest.host_permissions.includes("https://edublurtesting.ct.ws/*"));
assert.ok(manifest.host_permissions.includes("https://test.nop.wtf/*"));
});

test("AI suggestion command is declared without a browser-assigned default", () => {
Expand Down
11 changes: 6 additions & 5 deletions tests/settings-switches.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,12 @@ runTest("Test Question Helper stays opt-in inside Experimental", () => {
assert.match(settingsScript, /aiHelperMessagesToggle\.checked = result\[AI_HELPER_MESSAGES_KEY\] === true/);
});

runTest("the Stay Active test site asks for optional access before opening", () => {
assert.match(html, /<button class="inline-link inline-link-button" id="OpenTestingSiteButton" type="button"/);
assert.match(settingsScript, /const TESTING_SITE_PERMISSION = "https:\/\/edublurtesting\.ct\.ws\/\*";/);
assert.match(settingsScript, /chrome\.permissions\.request\(\{ origins: \[TESTING_SITE_PERMISSION\] \}/);
assert.match(settingsScript, /chrome\.tabs\.create\(\{ url: TESTING_SITE_URL \}\)/);
runTest("Stay Active testing opens the test site below the master switch", () => {
assert.doesNotMatch(html, /OpenTestingSiteButton|experimentalSubtitle/);
assert.doesNotMatch(settingsScript, /openTestingSiteButton|TESTING_SITE_URL|TESTING_SITE_PERMISSION/);
assert.match(html, /id="ee-test-shields" href="https:\/\/test\.nop\.wtf" target="_blank" rel="noopener noreferrer" data-i18n="samTestShields"/);
assert.ok(html.indexOf('id="ee-test-shields"') > html.indexOf('id="ActivityShieldEnabled"'));
assert.ok(html.indexOf('id="ee-test-shields"') < html.indexOf('id="spoofing-heading"'));
});

runTest("optional export tools are opt-in", () => {
Expand Down
Loading