Shopify themes, liquid, logos, and UX
My site: etherealoasis.co
My theme: Dawn
Is there a way to disable the ability to right-click and display a message instead on the shopify store?
Thanks in advance for any help!
Solved! Go to the solution
This is an accepted solution.
Hi @spacetimerider , You can try to add the code to a different file, for example, the "global.js" file.
Hi there! This is Paul from the Weaverse team. Sure, you can disable right-click and show a message instead. Just add this JavaScript code to your theme.js
file in the Assets folder:
document.addEventListener('contextmenu', function(e) {
e.preventDefault();
alert('Right-click is disabled on this site.');
});
Save the changes, and you're all set! Let me know if you need any more help.
Hi Paul,
Thank you for your assistance. I couldn't find a theme.js file in the Assets folder, but I did find theme-editor.js. I tried adding the code to that file, as it has some similar "document.addEventListener" lines already in there. But, it didn't change anything that I can tell. I can still right click. Thank you in advance for any assistance you can offer!
etherealoasis.co is my website and I'm using the Dawn theme
This is an accepted solution.
Hi @spacetimerider , You can try to add the code to a different file, for example, the "global.js" file.
adding it to "global.js" did the trick.. thank you!
Your solution helped me to.. Thank you soo much
Hi.. I placed the code in "global.js" in the asset folder, ir worked on desktop and android, but did not work on iphone. Is there a reason ? What can we do ?
Thanks
User | RANK |
---|---|
229 | |
165 | |
66 | |
55 | |
49 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023