Thanks!!
Topic summary
A user seeks to disable right-click functionality on their Shopify store using the Impact theme. Multiple developers provide similar solutions:
Proposed Solution:
- Navigate to Online Store → Themes → Edit Code
- Open the
theme.liquidfile - Insert JavaScript code above the
</body>tag that prevents the context menu from appearing
Code Variations Offered:
Two slightly different JavaScript implementations were shared:
- Using
oncontextmenu="return false;"in a script tag - Using
document.addEventListener('contextmenu', function(event) { event.preventDefault(); });
Current Status:
The discussion remains unresolved. The original poster tested the suggested solutions but reported they “doesn’t work,” indicating the code snippets failed to disable right-click as intended. One responder requested the store URL for further troubleshooting, but no follow-up solution has been provided yet.
Hey @zeyna111
Follow these Steps:
-
Go to Online Store
-
Edit Code
-
Find theme.liquid file
-
Add the following code in the bottom of the file above tag
If I managed to help you then, don’t forget to Like it and Mark it as Solution!
Best Regards,
Moeed
Hi @zeyna111 Please add the below code:
document.addEventListener('contextmenu', function (event) {
event.preventDefault();
});
Please follow the steps:
- Login in shopify admin.
- Click on the Online Store.
- Then click on the button next to Customize in live Theme.
- Click Edit Code.
- Search theme.liquid in the code in left hand side in your theme.
- Add the following code in the bottom of the file above tag
Hopefully it will help you. If yes then Please don’t forget hit Like and Mark it as solution!
Best Regards
Sahil
Hello, @zeyna111
Please share “Store URL”
Thanks!
Hello @zeyna111 ,
Here are the steps to apply the necessary changes in your Shopify store:
In your Shopify Admin, navigate to Online Store > Themes > Actions > Edit Code.
Locate layout>theme.liquid and paste the following code just before the closing tag:
Let me know if you need further assistance!
doesnt work…
doesn’t work…