Disable certain options from the default menu context

Asked

Viewed 299 times

0

I would like to know how I can disable context menu options in the best way possible, if you have any native form and it’s not hard to undo, it would be interesting.

An example for the expected result is the video tag of the site xvideos.com, they also have the option "Save video as ..." disabled, and the context menu is the default, I would like the same result.

inserir a descrição da imagem aqui

Edit:


I don’t want to create a custom javascript context menu, just disable default menu options, even if the form is javascript, but not create a new one.

  • In case I don’t want to create a custom context menu, just disable default menu options.

  • Then you can still use as a basis to accepted answer that this in the duplicate question, just you do not use the menu, see the example.

  • But I want to let the context menu work normal, just disable options from it, disable it totally could use the answer marked as duplicate, but not with respect to the default context menu.

  • Okay, I understand your problem, I do not know if this is possible, I will indicate your question to be reopened, it is worth you modify this part of your question desabilitar as opções for desabilitar determinadas opções or something like that, it’s also worth you putting what options are those you want to disable. = D

  • I will edit Icaro, vlw, and the example I passed is open content, but for those interested in the issue, it is worth accessing any xvideos video, delete a div qe is above the videos and see that in the video tag, is the same default menu.

  • If you just want to disable the Html5 tag download <video> maybe this one reply from Soen help you.

  • So I took a look that ai is applied in the player of the tag video, this has already applied in my project, it removes the button to download the player Html5

Show 2 more comments

1 answer

2


In principle it is not possible to enable or disable these menu options.

As it appears in the cited example may be related to how the content is being delivered to the browser and that it cannot download the content and not a matter of html or javascript.

This could be because the content is stream-like and or being delivered in Chunks (just an assumption).

What you can do is: Mark on controlsList of his <video> the property nodownload and "disable" the contextmenu of the element in question.

<!DOCTYPE html>
<html>

<body>
  <video id="videoPlayer" width="400" controls 
                                      controlsList="nodownload"
                                      oncontextmenu="return false;">
      <source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
      <source src="https://www.w3schools.com/html/mov_bbb.ogg" type="video/ogg">
</video>
</body>

</html>

  • From what I saw is really in block, with the video is downloaded the blocks named hls-720p<n_bloco>.ts. and the request returns video/mp2t type. I’ll mark your answer as a solution, but for learning, would you have any link or guidance on how to search for this type of video? because from what I saw the video src does not change, so it is made only a request and I believe that the browser itself does the rest. (I’m guessing..)

  • @Henriazevedo You must search for Mooth streaming or adaptive bitrate.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.