ISMIS Helper: cross-browser build, CI, PDF fixes, Chrome download fix #1

Merged
adrianbonpin merged 55 commits from feat/ismis-helper into prod 2026-08-18 19:13:50 +00:00
Showing only changes of commit b09e0cea76 - Show all commits
+8 -3
View File
@@ -156,13 +156,18 @@
if (!included.length) throw new Error('No enrolled courses found.'); if (!included.length) throw new Error('No enrolled courses found.');
const totalUnits = ISMIStools.sumUnits(included); const totalUnits = ISMIStools.sumUnits(included);
const html = ISMIStools.buildStudyLoadHtml({ header, courses: included, totalUnits }); const html = ISMIStools.buildStudyLoadHtml({ header, courses: included, totalUnits });
const win = window.open('', '_blank'); const blob = new Blob([html], { type: 'text/html' });
const url = URL.createObjectURL(blob);
const win = window.open(url, '_blank');
if (!win) { if (!win) {
URL.revokeObjectURL(url);
showToast('Popup blocked — allow popups for this site, then try again.', true); showToast('Popup blocked — allow popups for this site, then try again.', true);
return; return;
} }
win.document.write(html); // The blob document runs its own onload → window.print(). Never touch
win.document.close(); // win.document here: if the new tab navigates cross-origin, accessing it
// throws "Permission denied".
setTimeout(() => URL.revokeObjectURL(url), 60000);
showToast('Opened printable Study Load.'); showToast('Opened printable Study Load.');
} catch (err) { } catch (err) {
showToast('Error: ' + ((err && err.message) || err), true); showToast('Error: ' + ((err && err.message) || err), true);