Skip to content

Commit

Permalink
fix: block Safari on SCORM player page as well as viewer
Browse files Browse the repository at this point in the history
/mod/scorm/player.php and /mod/scorm/view.php need the Safari warning
students can go directly to the player
  • Loading branch information
phette23 committed Aug 13, 2024
1 parent f4f54f5 commit 2974de1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion additionalhtml/safari-scorm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// two questions: 1) should we _prevent_ users from even starting the SCORM?
// 2) should we target the "Personal Skills for a Diverse Campus" SCORM specifically, by checking against the page title, or all SCORMs?
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)
if (location.pathname.match('/mod/scorm/view.php') && isSafari) {
if (location.pathname.match('/mod/scorm/') && isSafari) {
// let some of the page load before interrupting it
// using window.addEventListener('load',...) can cause an AJAX error in Moodle
document.addEventListener('DOMContentLoaded', () => {
Expand Down

0 comments on commit 2974de1

Please sign in to comment.