diff --git a/frontend/src/app.js b/frontend/src/app.js index 1b62a7481..35f4a4da5 100644 --- a/frontend/src/app.js +++ b/frontend/src/app.js @@ -109,7 +109,10 @@ const router = new Router({ }); router.beforeEach((to, from, next) => { - if (to.matched.some((record) => record.meta.settings) && config.values.disable.settings) { + if (document.documentElement.className) { + // Disable back button in full-screen viewers and editors. + next(false); + } else if (to.matched.some((record) => record.meta.settings) && config.values.disable.settings) { next({ name: "home" }); } else if (to.matched.some((record) => record.meta.admin)) { if (isPublic || session.isAdmin()) { diff --git a/frontend/src/share.js b/frontend/src/share.js index dfe5f7c10..3f8ffc907 100644 --- a/frontend/src/share.js +++ b/frontend/src/share.js @@ -109,7 +109,10 @@ const router = new Router({ }); router.beforeEach((to, from, next) => { - if (to.matched.some((record) => record.meta.settings) && config.values.disable.settings) { + if (document.documentElement.className) { + // Disable back button in full-screen viewers and editors. + next(false); + } else if (to.matched.some((record) => record.meta.settings) && config.values.disable.settings) { next({ name: "home" }); } else if (to.matched.some((record) => record.meta.admin)) { if (isPublic || session.isAdmin()) {