[SOLVED] Toolbox: Photo Gallery - Prevent Image Download

All WYSIWYG Web Builder support issues that are not covered in the forums below.
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
Post Reply
User avatar
AliGW
 
 
Posts: 431
Joined: Thu Dec 19, 2024 3:41 pm

[SOLVED] Toolbox: Photo Gallery - Prevent Image Download

Post by AliGW »

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.
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).
User avatar
Pablo
 
Posts: 24482
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Toolbox: Photo Gallery - Prevent Image Download

Post by Pablo »

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
User avatar
AliGW
 
 
Posts: 431
Joined: Thu Dec 19, 2024 3:41 pm

Re: Toolbox: Photo Gallery - Prevent Image Download

Post by AliGW »

That works on a desktop, but not on a mobile phone, sadly.

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).
User avatar
AliGW
 
 
Posts: 431
Joined: Thu Dec 19, 2024 3:41 pm

Re: Toolbox: Photo Gallery - Prevent Image Download

Post by AliGW »

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).
User avatar
AliGW
 
 
Posts: 431
Joined: Thu Dec 19, 2024 3:41 pm

Re: Toolbox: Photo Gallery - Prevent Image Download

Post by AliGW »

This seems to be what's needed, but I don't know where to put it. Does anyone know?

Code: Select all

body {
  -webkit-touch-callout: none;
}
Thanks.
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).
User avatar
Pablo
 
Posts: 24482
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Toolbox: Photo Gallery - Prevent Image Download

Post by Pablo »

You can put it in Page HTML, between head tags

Code: Select all

<style>
body {
  -webkit-touch-callout: none;
}
</style>
User avatar
AliGW
 
 
Posts: 431
Joined: Thu Dec 19, 2024 3:41 pm

Re: Toolbox: Photo Gallery - Prevent Image Download

Post by AliGW »

Perfect - thanks, Pablo! :D
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).
joseluz
 
 
Posts: 44
Joined: Wed Nov 23, 2016 2:17 am

Re: [SOLVED] Toolbox: Photo Gallery - Prevent Image Download

Post by joseluz »

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>
User avatar
AliGW
 
 
Posts: 431
Joined: Thu Dec 19, 2024 3:41 pm

Re: [SOLVED] Toolbox: Photo Gallery - Prevent Image Download

Post by AliGW »

Thanks for this. The issue is already resolved, but this may help someone else. :)

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).
Post Reply