addListener('backButton', ...) not working in svelte 4 #6924
Answered
by
islamzaoui
islamzaoui
asked this question in
Q&A
-
Hello for some reason addListener('backButton', ...) does not working in my sveltekit app import { App } from '@capacitor/app';
import { browser } from '$app/environment';
App.addListener('backButton', async () => {
if (browser) window.history.back();
}); but i get this error every time when in run it in dev mode document.addEventListener('visibilitychange', this.handleVisibilityChange, false);
^
ReferenceError: document is not defined is there any way to solve this |
Beta Was this translation helpful? Give feedback.
Answered by
islamzaoui
Sep 20, 2023
Replies: 1 comment
-
this is the solution:
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
islamzaoui
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this is the solution: