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
Reading Time: 2min read
419 22
0
Disable right click with javascript
607
SHARES
2.8k
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

How to Create CSS Blurred and Opacity(Transparent) Background[CODE]

How To Align the Content of a Div to the Bottom with CSS[CODE]

How To Setup StackPath CDN With Your WordPress Website

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
Share243Tweet152Share61

Related Posts

How to Create CSS Blurred and Opacity(Transparent) Background
CSS

How to Create CSS Blurred and Opacity(Transparent) Background[CODE]

by 22bulbjungle
April 12, 2021
0

(Video transcription) Here on my screen on the left, I have my HTML document and on the right is the live browser...

Read more
How to align content of a div to the bottom

How To Align the Content of a Div to the Bottom with CSS[CODE]

April 12, 2021
How To Setup StackPath CDN With Your WordPress Website

How To Setup StackPath CDN With Your WordPress Website

March 24, 2021
How to Add Custom CSS and JavaScript File in Shopify

How to Add Custom CSS and JavaScript in Shopify (EASY)

March 24, 2021
How to Create CSS Blurred and Opacity(Transparent) Background

How to Create CSS Blurred and Opacity(Transparent) Background[CODE]

April 12, 2021
How to align content of a div to the bottom

How To Align the Content of a Div to the Bottom with CSS[CODE]

April 12, 2021
How To Setup StackPath CDN With Your WordPress Website

How To Setup StackPath CDN With Your WordPress Website

March 24, 2021
How to Add Custom CSS and JavaScript File in Shopify

How to Add Custom CSS and JavaScript in Shopify (EASY)

March 24, 2021
How To Add Checkout Autofill or Autocomplete Address on the Address Field in WooCommerce

How To Add Checkout Autofill/Autocomplete Address on the Address Field in WooCommerce

March 24, 2021
How to Get Paypal API Credentials (Username, Password, Signature)

[UPDATED 2021] How to Get Your PayPal API Credentials (Username, Password, and Signature to Woocommerce)

March 31, 2021

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

How to Create CSS Blurred and Opacity(Transparent) Background

How to Create CSS Blurred and Opacity(Transparent) Background[CODE]

April 12, 2021
How to align content of a div to the bottom

How To Align the Content of a Div to the Bottom with CSS[CODE]

April 12, 2021

Categories

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

© 2021 22BulbJungle.

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

© 2021 22BulbJungle.

Welcome Back!

Login to your account below

Forgotten Password?

Create New Account!

Fill the forms below 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.