# Disable right click on images

**URL:** https://meta.discourse.org/t/disable-right-click-on-images/96362
**Category:** Marketplace
**Created:** [September 4, 2018, 11:37pm UTC](https://meta.discourse.org/t/disable-right-click-on-images/96362 "2018-09-04T23:37:38Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [September 5, 2018, 7:03pm UTC](https://meta.discourse.org/t/disable-right-click-on-images/96362/2 "2018-09-05T19:03:54Z")

</div>

The `onPageChange` event should help you:

> [@Developing Discourse Themes & Theme Components](https://meta.discourse.org/t/developer-s-guide-to-discourse-themes/93648#heading--4-c-11):
>
> Discourse Themes and Theme Components can be used to customize the look, feel and functionality of Discourse’s frontend. This section of the developer guides aims to provide all the reference materials you need to develop simple themes for a single site, right up to complex open-source theme components. This introduction aims to provide a map of all the tools and APIs for theme development. If you prefer a step-by-step tutorial for theme development, jump straight to: Themes vs. Theme Compon…

It’s executed whenever the user navigates in Discourse. `$(document).ready` isn’t enough because Discourse normally avoids full page reloads.

Something like this could work for you:

```javascript
<script type="text/discourse-plugin" version="0.8">
  api.onPageChange((url, title) => {
    $("img").bind("contextmenu",function(e) {
      return false;
    });
  });
</script>

```

This doesn’t handle posts that are inserted into the page by infinite scrolling, but maybe it’s enough to appease your users 🙂

(I understand this is a #Marketplace post and you are looking for a fully baked solution. This isn’t that, but I thought it might still help.)

---

_[View the full topic](https://meta.discourse.org/t/disable-right-click-on-images/96362)._
