Ditutup

Disable right-click and highlight on this <object> element without disabling scrolling

I have an <object> element (see below) into which a PDF is being loaded. Currently, users can simply right-click on it and download it in Chrome. Firefox even shows a download button.

I want to prevent users from downloading the PDF, so I want to disable right-click, and I also want to prevent them from highlighting and copying the text. And since <object> elements don't respond to click events, I am handling the click event in the <div> below it with (contextmenu)= "myFunction()".

The problem is that disabling right-click in this way also disables scrolling for some reason. So does style="pointer-events: none". I need to disable right-clicks and highlighting on the PDF but the user still needs to be able to scroll to view the pages below.

I am using Angular 7 so this is being done with HTML and Typescript. The PDF file is coming from Firebase Storage.

<object width="100%" height="690" type="application/pdf" [data]="([login to view URL])">

<div style="position:absolute; top:0; left:0; bottom:0; right:0;" (contextmenu)="onRightClick($event)"></div>

Kemahiran: CSS, HTML5, Javascript, PDF - Format Dokumen Mudah Alih, Typescript

Lihat lagi: disable text selection html, css remove blue highlight on click, remove blue border on click, javascript prevent highlight, how can i prevent text/element selection with cursor drag, css user-select, css disable mobile click highlight, css remove highlight on click, disable right click mouse globally vba, disable right click flv, vb6 webbrowser disable right click, vb6 disable right click mouse windows, disable right click javascript cartweaver, iframe disable right click iframe, disable right click iframe, disable right click actionscript, disable right click mouse windows, disable right click firefox iframe, webbrowser disable right click, html iframe disable right click

Tentang Majikan:
( 2 ulasan ) Antelope, United States

ID Projek: #19242121

11 pekerja bebas membida secara purata $29 untuk pekerjaan ini

maxsmith8

Hello there, I am interested and ready to start. I will do this in 2 Hours. Please visit our profile reviews to make confidence working with us https://www.freelancer.com/u/maxsmith8.html#/reviews looking Lagi

$30 USD dalam 0 hari
(91 Ulasan)
6.9
bjrupani

Hello hiring member i am bhavika i have 3+years experience in php , laravel , ajax ,html ,css , bootstrap so i can do it and i can start it right now so please give me chance to serve you thanks in advance :)

$30 USD dalam sehari
(77 Ulasan)
5.9
aswebsmart

Hi, Your requirements are fully clear to me and I am applying only because I meet all the requirements that you are looking for. I have been working as a wordpress developer and designer for more than 6 years and I Lagi

$25 USD dalam sehari
(18 Ulasan)
3.8
ftitechnologies

Hello, Thanks for posting your requirements over here. As per my understanding, you are looking for someone who can disable right click and highlighting and copying the text. We can help you to disable right c Lagi

$40 USD dalam sehari
(1 Ulasan)
2.8
smsaurabhv

Hi, ⭐⭐My understanding⭐⭐ You need experienced chrome extension developer. I believe, I can do this with ease as i have much experience in chrome development and created 30+ chrome extensions in different domain Lagi

$30 USD dalam sehari
(9 Ulasan)
3.4
sid893

Hello, I am an angular expert. I am working as a frontend developer at an MNC for more than 4 years. And in these year I have worked on large scale on going projects as well as created the projects from scrat Lagi

$20 USD dalam sehari
(1 Ulasan)
1.0
techlinesols6

"Hi, Hope you are doing well! Thanks for sharing your project requirement with us. It will be our great pleasure to work on your project. I have checked your requirement, yes we can do it, because we already work on si Lagi

$34 USD dalam 7 hari
(0 Ulasan)
0.0
liraneilary

Skilled and Friendly WEB DEVELOPER. FAST WORK & HIGH QUALITY! IMAGINE that, If YOU hire ME you will get the BEST & FAST services.

$35 USD dalam 2 hari
(0 Ulasan)
0.0
$15 USD dalam 3 hari
(0 Ulasan)
0.0
JibranYousufJY

Hey, I saw your job posting for "Disable right-click and highlight on this <object> element without disabling scrolling" and believe that I have the right skills and temperament for it. Let me introduce myself. Lagi

$30 USD dalam sehari
(0 Ulasan)
0.0
Muthuyuv

I can able to solve this issue. I already worked in javascript and Angular versions. Please give all the required details so that I can solve this with in a day

$25 USD dalam sehari
(0 Ulasan)
0.0