diff --git a/Telegram/Resources/iv_html/page.js b/Telegram/Resources/iv_html/page.js
index 4b43286b7..26cab565c 100644
--- a/Telegram/Resources/iv_html/page.js
+++ b/Telegram/Resources/iv_html/page.js
@@ -330,6 +330,7 @@ var IV = {
+ '" type="video/mp4" />'
+ '';
var media = element.firstChild;
+ media.oncontextmenu = function () { return false; };
media.oncanplay = IV.checkVideos;
media.onloadeddata = IV.checkVideos;
}
diff --git a/Telegram/SourceFiles/iv/iv_prepare.cpp b/Telegram/SourceFiles/iv/iv_prepare.cpp
index e4e69b2de..9e276bce7 100644
--- a/Telegram/SourceFiles/iv/iv_prepare.cpp
+++ b/Telegram/SourceFiles/iv/iv_prepare.cpp
@@ -516,6 +516,7 @@ QByteArray Parser::block(
const auto id = Number(photo.id);
result = tag("a", {
{ "href", href },
+ { "oncontextmenu", data.vurl() ? QByteArray() : "return false;" },
{ "data-context", data.vurl() ? QByteArray() : "viewer-photo" + id },
}, result) + caption(data.vcaption());
return result;
@@ -576,6 +577,7 @@ QByteArray Parser::block(
const auto href = resource("video" + id);
result = tag("a", {
{ "href", href },
+ { "oncontextmenu", "return false;" },
{ "data-context", "viewer-video" + id },
}, result);
}
@@ -745,6 +747,7 @@ QByteArray Parser::block(const MTPDpageBlockAudio &data) {
const auto src = documentFullUrl(audio);
return tag("figure", tag("audio", {
{ "src", src },
+ { "oncontextmenu", "return false;" },
{ "controls", std::nullopt },
}) + caption(data.vcaption()));
}