Skip to content

Commit 88d2f60

Browse files
committed
Merge branch 'main' into prep-1.0.3
2 parents 40ac624 + 1a18c1c commit 88d2f60

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{# Disable opening attached images in Progressive Web Apps #}
2+
{% if S_VIEWTOPIC %}
3+
<script>
4+
const isStandalone = window.matchMedia('(display-mode: standalone)').matches
5+
|| window.navigator.standalone === true;
6+
7+
if (isStandalone) {
8+
document.querySelectorAll('a > img.postimage').forEach(img => {
9+
const link = img.closest('a');
10+
if (link) {
11+
link.addEventListener('click', e => {
12+
e.preventDefault();
13+
});
14+
}
15+
});
16+
}
17+
</script>
18+
{% endif %}

0 commit comments

Comments
 (0)