Skip to content

Commit

Permalink
Merge pull request #94 from Suwayomi/main
Browse files Browse the repository at this point in the history
auto exit fullscreen if mobileFullScreenOnChapterPage
  • Loading branch information
Robonau authored Nov 17, 2023
2 parents ceec329 + ee5913a commit 1e2487e
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,25 @@
export let data: PageData;
let mangaMeta = MangaMeta(data.MangaID);
$: if (
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) &&
$mangaMeta.mobileFullScreenOnChapterPage
) {
document.documentElement.requestFullscreen();
}
onMount(() => {
if (
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) &&
$mangaMeta.mobileFullScreenOnChapterPage
) {
document.documentElement.requestFullscreen();
}
return () => {
if (
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
navigator.userAgent
) &&
$mangaMeta.mobileFullScreenOnChapterPage
) {
document.exitFullscreen();
}
};
});
let topchapter: number;
onMount(() => {
Expand Down

0 comments on commit 1e2487e

Please sign in to comment.