On a desktop in a browser, the right-click option to download images is disabled by default, but this is not the case in a mobile browser (I am using Firefox for both, but testers have told me it's the same in other mobile browsers). This site is for a camera club, so we'll want the same on mobile as on desktop, but how? I am talking about the thumbnail images in the gallery, nut the ones in the lightbox.
CAVEAT: We know that you can't completely prevent image download, but we don't want to make it as easy as long pressing the image and being offered download as an option!
Thanks.
[SOLVED] Toolbox: Photo Gallery - Prevent Image Download
Forum rules
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
- AliGW
-

- Posts: 431
- Joined: Thu Dec 19, 2024 3:41 pm
[SOLVED] Toolbox: Photo Gallery - Prevent Image Download
Last edited by AliGW on Mon Apr 06, 2026 6:02 am, edited 1 time in total.
Ali
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
- Pablo
- Posts: 24482
- Joined: Sun Mar 28, 2004 12:00 pm
- Location: Europe
- Contact:
Re: Toolbox: Photo Gallery - Prevent Image Download
The context menu is a browser feature, it is not something that is added or controlled by WWB.
But you can try to disable the context menu via JavaScript -> Ready-to-use-JavaScript->disable right click
But you can try to disable the context menu via JavaScript -> Ready-to-use-JavaScript->disable right click
- AliGW
-

- Posts: 431
- Joined: Thu Dec 19, 2024 3:41 pm
Re: Toolbox: Photo Gallery - Prevent Image Download
That works on a desktop, but not on a mobile phone, sadly.
Is there any code that I can add to the object?
Is there any code that I can add to the object?
Ali
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
- AliGW
-

- Posts: 431
- Joined: Thu Dec 19, 2024 3:41 pm
Re: Toolbox: Photo Gallery - Prevent Image Download
I found this, but I don't seem to be able to make the CSS snippet work: https://additionalknowledge.com/2024/08 ... ri-chrome/
Ali
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
- AliGW
-

- Posts: 431
- Joined: Thu Dec 19, 2024 3:41 pm
Re: Toolbox: Photo Gallery - Prevent Image Download
This seems to be what's needed, but I don't know where to put it. Does anyone know?
Thanks.
Code: Select all
body {
-webkit-touch-callout: none;
}Ali
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
- Pablo
- Posts: 24482
- Joined: Sun Mar 28, 2004 12:00 pm
- Location: Europe
- Contact:
Re: Toolbox: Photo Gallery - Prevent Image Download
You can put it in Page HTML, between head tags
Code: Select all
<style>
body {
-webkit-touch-callout: none;
}
</style>- AliGW
-

- Posts: 431
- Joined: Thu Dec 19, 2024 3:41 pm
Re: Toolbox: Photo Gallery - Prevent Image Download
Perfect - thanks, Pablo! 
Ali
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
-
joseluz
-

- Posts: 44
- Joined: Wed Nov 23, 2016 2:17 am
Re: [SOLVED] Toolbox: Photo Gallery - Prevent Image Download
Hi.
Advanced users know many methods to disable the download, but for me, the following script worked to disable it on both PC and mobile, Put this script in the HTML between head and head:
<script>
document.addEventListener('contextmenu', function(e) {
e.preventDefault();
});
</script>
Advanced users know many methods to disable the download, but for me, the following script worked to disable it on both PC and mobile, Put this script in the HTML between head and head:
<script>
document.addEventListener('contextmenu', function(e) {
e.preventDefault();
});
</script>
- AliGW
-

- Posts: 431
- Joined: Thu Dec 19, 2024 3:41 pm
Re: [SOLVED] Toolbox: Photo Gallery - Prevent Image Download
Thanks for this. The issue is already resolved, but this may help someone else. 
By the way, you need code tags, not script tags.
By the way, you need code tags, not script tags.
Ali
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).