DISCOVER
×

How to copy a picture that won't allow you to right click

Updated April 17, 2017

The Internet contains millions of pictures that you can copy for free. Browsers have context menus that allow you right-click image files and save them to your hard drive. To prevent this from happening, some Web developers use JavaScript functions to protect their images. When you right-click such a page, a message will tell you that the right-click is disabled. You can bypass that message and save any picture that you like by using your own JavaScript function.

Visit a website that prevents you from right-clicking a picture.

Copy the following JavaScript code:

JavaScript:function $vrc$$() {

document.onclick=null; document.oncontextmenu=null; document.onmousedown=null;document.onmouseup = null;

}

void ($vrc$$());

Click the URL in your browser's address bar. The browser will highlight the URL.

Right-click the highlighted URL and select "Paste." Windows will paste the text into the address bar.

Press "Enter." The browser will execute the JavaScript command.

Right-click any picture on the Web page and select "Save" to save the picture.

Press "F5" to refresh the page.

Tip

The JavaScript code temporarily deactivates the Web page's mouse events. Pressing "F5" reloads the page and restores the page to normal. Save the JavaScript code so that you can paste it again when you need it. You can also store it in a browser bookmarklet. This will allow you to access it quickly.

bibliography-icon icon for annotation tool Cite this Article

About the Author

After majoring in physics, Kevin Lee began writing professionally in 1989 when, as a software developer, he also created technical articles for the Johnson Space Center. Today this urban Texas cowboy continues to crank out high-quality software as well as non-technical articles covering a multitude of diverse topics ranging from gaming to current affairs.