# Prevent downloading of posted images

**URL:** <https://meta.discourse.org/t/prevent-downloading-of-posted-images/99689>\
**Category:** Product Support\
**Created:** [16.Октябрь.2018 22:50:34 UTC](https://meta.discourse.org/t/prevent-downloading-of-posted-images/99689 "2018-10-16T22:50:34Z")\
**Posts on this page:** 1\
**Showing post:** 31

<div class="post-metadata">

**Author:** ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)\
**Post date:** [23.Январь.2024 16:15:59 UTC](https://meta.discourse.org/t/prevent-downloading-of-posted-images/99689/31 "2024-01-23T16:15:59Z")

</div>

Вот обновлённая версия, которую мне удалось исправить!

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

<script type="text/discourse-plugin" version="0.8">
  api.onPageChange((url, title) => {
    $("body").on("contextmenu", ".cooked img, .mfp-img", function(e) {
      e.preventDefault();
    });
  });
</script>

```

---

_[View the full topic](https://meta.discourse.org/t/prevent-downloading-of-posted-images/99689)._
