Kapalı

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>

Beceriler: CSS, HTML5, Javascript, PDF, Typescript

Daha fazlasını gör: 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

İşveren Hakkında:
( 2 değerlendirme ) Antelope, United States

Proje NO: #19242121

Bu iş için 11 freelancer ortalamada $29 teklif veriyor

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 Daha Fazla

$30 USD in 0 gün içinde
(91 Değerlendirme)
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 :)

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(77 Değerlendirme)
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 Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(18 Değerlendirme)
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 Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(1 Yorum)
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 Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(9 Değerlendirme)
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 Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(1 Yorum)
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 Daha Fazla

$34 USD in 7 gün içinde
(0 Değerlendirme)
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 in 2 gün içinde
(0 Değerlendirme)
0.0
$15 USD in 3 gün içinde
(0 Değerlendirme)
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. Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
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

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0