HOT
22bulbjungle
No Result
View All Result
22bulbjungle
No Result
View All Result
Home Web Development Javascript

Disable Right Click with Javascript

in Javascript, Web Development
2 min read
417 22
0
Disable right click with javascript
604
SHARES
2.7k
VIEWS
Share on FacebookShare on Twitter

Disable right click to prevent end users the capabilities to inspect, print, or copy.

I do not recommend adding this into your web-pages but here is the tutorial.

RelatedPosts

CSS Tricks: Expand Card on Hover Effect (Game of Thrones theme | CODE INSIDE)

How To Create an Overlay Zoom Hover Effect in CSS [CODE]

How to Create a Direct Download Link in WordPress

Disable right click with javascript

Disable right click and content copying

Preventing the user from copying your content may also be one of the reason why you want to disable the right click function. It may be useless because someone can manage to use the shortcut key Ctrl+C to copy. Using CSS is a better way to prevent the user from copying.

Try to look at the code below and right-click on the result tab.

Find out how to disable a user from copying your texts using CSS:

  • How To Disable Text Selection With CSS User Select

Just make sure you also disable the right-click function so a user cannot inspect through right-clicking.

Disable right click on images

The major reason to disable the right-click is to prevent the users from inspecting your code. Preventing them also disable them to download images.

Try to look at the code below and see how the JavaScript function is used to disable the right click into images.

Did you know, a user can also get your images through downloading the whole web document?

The document will have the webpage’s HTML, CSS, JS, images and other files that can be viewed without an internet connection. Images inside the downloaded document were the actual image from a live web page.

Another thing, a user can also use the page info feature in firefox browser to find the image by going to the media tab and clicking on the links to preview the image.

The only problem is, a user can disable the JavaScript in the browser. Hence, the script added would not run.

A user can disable JavaScript in Chrome by going to this path: chrome://settings/content .

chrome_content_settings

Under JavaScript, there are two radio options allow and disallow JavaScript.

In Mozilla Firefox, the user can disable JavaScript by going to this path: about:config within the browser.

firefox_about_config

Next, click the button saying “I accept the risk”. Search for JavaScript, then right-click and click on toggle.

This will turn JavaScript into false indicates that it is now disabled.

I would not recommend disabling right-click function but if for some reasons / for debugging purposes etc or even a first steps to protect your own copyright images.

Tags: Content CopyingImagesJavaScriptRight ClickTutorial
Share242Tweet151Share60

Related Posts

Window cards expand on hover with CSS
CSS

CSS Tricks: Expand Card on Hover Effect (Game of Thrones theme | CODE INSIDE)

by business22bulbjungle
September 21, 2020
0

<div class="drogon"><img src="drogon.png" /></div> <div class="house-lists"> <div class="house" style="background-image: url('stark.png');"> <div class="house-inner"> <div class="sigil"><img src="sigil/sigil-stark.png" /></div> <div class="house-name">Stark</div> </div> </div> <div class="house"...

Read more
How To Create an Overlay Zoom Effect in CSS

How To Create an Overlay Zoom Hover Effect in CSS [CODE]

September 21, 2020
How to Create a download link in wordpress

How to Create a Direct Download Link in WordPress

April 27, 2020
How to Change Chrome DevTools Theme Color (Developer Tools)

How to Change Chrome DevTools Theme Color (Developer Tools)

April 27, 2020

Trending

How to create news ticker horizontal- scrolling text
CSS

How to Create a Horizontal News Ticker with CSS Only (Scrolling Texts | CODE)

11 months ago
Frontend vs Backend
Web Development

Frontend vs Backend Comparison (Languages, Frameworks and Libraries)

12 months ago
How to hide or remove woocommerce my account either tabs
Video

How to Remove My Account Menu Links in Woocommerce

12 months ago
How to Create Paypal Sandbox Account in 2020
Ecommerce

How to Create Paypal Sandbox Test Account in 2020

1 year ago
How to Create a CSS Equal Height Columns Create Div Columns with the Same Height-min
CSS

How to Create a CSS Equal Height Columns (Create Div Columns with the Same Height)

1 year ago

Free Do it yourself tutorials on CSS, HTML, Photoshop, Wordpress, and Woocommerce to help you learn web development and graphic design.

Follow Us

Recent News

Windows Multiple Copy and Paste (Copy and Paste in One Go)

Windows Multiple Copy and Paste (Copy and Paste in One Go)

December 19, 2020
Window cards expand on hover with CSS

CSS Tricks: Expand Card on Hover Effect (Game of Thrones theme | CODE INSIDE)

September 21, 2020

Categories

  • CSS
  • Ecommerce
  • Graphic Design
  • Javascript
  • PC Tips
  • Photoshop
  • Responsive design
  • Video
  • Web Development
  • Woocommerce
  • Wordpress
  • Home
  • Blog
  • Web Development
  • Graphic Design

© 2020 22BulbJungle.

No Result
View All Result
  • Home
  • Blog
  • Web Development
    • CSS
    • Javascript
    • WordPress
  • Graphic Design
    • Photoshop

© 2020 22BulbJungle.

Welcome Back!

Login to your account below

Forgotten Password?

Create New Account!

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In
This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.