{"id":42117435,"url":"https://github.com/cgkineo/adapt-close","last_synced_at":"2026-01-26T14:11:13.864Z","repository":{"id":27828844,"uuid":"31318645","full_name":"cgkineo/adapt-close","owner":"cgkineo","description":"An extension to add a close button and/or prompts","archived":false,"fork":false,"pushed_at":"2025-12-29T17:43:38.000Z","size":150,"stargazers_count":4,"open_issues_count":0,"forks_count":10,"subscribers_count":10,"default_branch":"master","last_synced_at":"2026-01-01T22:56:05.950Z","etag":null,"topics":["adapt","extension"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cgkineo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-02-25T14:57:08.000Z","updated_at":"2025-12-29T17:43:39.000Z","dependencies_parsed_at":"2024-03-13T17:53:41.414Z","dependency_job_id":"a30c3dfc-d8f4-41ac-86f3-c02bb3062d77","html_url":"https://github.com/cgkineo/adapt-close","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/cgkineo/adapt-close","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgkineo%2Fadapt-close","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgkineo%2Fadapt-close/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgkineo%2Fadapt-close/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgkineo%2Fadapt-close/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cgkineo","download_url":"https://codeload.github.com/cgkineo/adapt-close/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgkineo%2Fadapt-close/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28780339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adapt","extension"],"created_at":"2026-01-26T14:11:13.021Z","updated_at":"2026-01-26T14:11:13.859Z","avatar_url":"https://github.com/cgkineo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Close\r\n\r\nAn extension to add a close button and/or prompts.\r\n\r\nAs of v2.1.0 this extension will now call `LMSFinish` on close if the [Spoor extension](https://github.com/adaptlearning/adapt-contrib-spoor) is installed, enabled and connected to an LMS. This can be used as a workaround for those Learning Management Systems that are affected by the [disallow sync XHR in page dismissal](https://github.com/adaptlearning/adapt_framework/wiki/SCORM,-closing-windows,-LMSFinish-and-synchronous-XHR-dismissals) change to Chromium-based browsers (such as Chrome, Edge and Opera) and which have yet to be updated to avoid being affected by this change. Note that this will only work if the close button functionality is enabled and the learner uses the close button to close the course. It will **not** have any impact if the learner closes the browser window/tab directly.\r\n\r\n## Installation\r\n* Add the [example JSON](example.json) to `course.json`.\r\n* With [Adapt CLI](https://github.com/adaptlearning/adapt-cli) installed, run `adapt install close`. Alternatively, [download the ZIP](https://github.com/cgkineo/adapt-close/archive/master.zip) and extract into the src \u003e extensions directory.\r\n* Run an appropriate Grunt task.\r\n\r\n## Usage\r\n* A close button can be added to the navigation bar.\r\n* When the learner clicks the close button, a [Notify](https://github.com/adaptlearning/adapt_framework/wiki/Core-modules#notify) prompt can be shown that asks the learner to confirm they want to exit (or return to the course)\r\n* A browser dialog can be displayed if the learner closes the window/tab in a normal fashion i.e. using the browser window/tab close button/equivalent keyboard shortcut\r\n\r\n## Attributes\r\n### `_isEnabled` (boolean):\r\nEnables/disables this extension. The default value is `false`. Set this to `true` to enable this extension.\r\n\r\n### `browserPromptIfIncomplete` (string):\r\nPopulate with text to display a browser dialog if the learner attempts to close the course window/tab when the course hasn't yet been completed\r\n\r\n### `browserPromptIfComplete` (string):\r\nPopulate with text to display a browser dialog if the learner attempts to close the course window/tab when the course has been completed\r\n\r\n  **Note:** Firefox, Chrome and Edge do not allow custom text to be included in the browser dialog. Additionally, most 'evergreen' browsers now seem to ignore any attempt to display a dialog in response to the `beforeunload` event if the user hasn't interacted with the page.\r\n\r\n### `_button` (object):\r\nContains the following settings:\r\n\r\n  * `_isEnabled` (boolean):  \r\nControls whether a close button should be added to the top navigation bar or not. Set this to `false` if you just want to have the browser dialog (see above) show on exit. The default value is `false`.\r\n\r\n  * `_closeViaLMSFinish` (boolean): \r\nSet to `true` to let the SCORM `LMSFinish` routine handle closing the course. This can be useful when the course hasn't been opened in a new window or where the course window can't be closed via JavaScript. This setting should only be enabled if the course will be launched from a SCORM-conformant Learning Management System that supports this functionality. The default value is `false`.\r\n\r\n  * `_notifyPromptIfIncomplete` (object):  \r\nContains the following settings:\r\n\r\n    * `_isEnabled` (boolean):  \r\nControls whether a prompt should be displayed if the learner clicks the close button when the course hasn't yet been completed. The default value is `false`.\r\n\r\n    * `title` (string):  \r\nTitle of the prompt e.g. \"Confirm close\"\r\n\r\n    * `body` (string):  \r\nBody text of the prompt e.g. \"Are you sure you want to exit the course? You have not yet completed all the content.\"\r\n\r\n    * `confirm` (string):  \r\nConfirm button text e.g. \"Exit course\".\r\n\r\n    * `cancel` (string):  \r\nCancel button text e.g. \"Cancel\".\r\n\r\n  * `_notifyPromptIfComplete` (object):  \r\nContains the following settings:\r\n\r\n    * `_isEnabled` (boolean):  \r\nControls whether a prompt should be displayed if the learner clicks the close button when the course has been completed. The default value is `false`.\r\n\r\n    * `title` (string):  \r\nTitle of the prompt e.g. \"Confirm close\"\r\n\r\n    * `body` (string):  \r\nBody text of the prompt e.g. \"Are you sure you want to exit the course?\"\r\n\r\n    * `confirm` (string):  \r\nConfirm button text e.g. \"Exit course\".\r\n\r\n    * `cancel` (string):  \r\nCancel button text e.g. \"Cancel\".\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgkineo%2Fadapt-close","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcgkineo%2Fadapt-close","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgkineo%2Fadapt-close/lists"}