ForrestLedbetter.com Rotating Header Image

By BoLOHLONE payday loans

Enable Right Click

UPDATE: Do not keep this script enabled, only use it as needed. It could cause some issues while browsing, as it loops through every HTML element on the page.

Greasemonkey script to reenable right clicking on sites that disable it for “security” purposes:

EnableRightClick.user.js

Code:
// ==UserScript==
// @name           enable right click
// @namespace      http://forrestledbetter.com
// @description    enable right click
// ==/UserScript==

if (document.all)
{
	iElements = document.all.length;

	for (i = 0;i < iElements;i++)
	{
		document.all[i].setAttribute("oncontextmenu", "return true;");
	}
}
else
{
	iElements = document.getElementsByTagName('*').length;
	aElements = document.getElementsByTagName('*');
	for (i = 0;i < iElements;i++)
	{
		aElements[i].setAttribute("oncontextmenu", "return true;");
	}

}

3 Comments

  1. Tendron says:

    Thank you! I’ve been tinkering with something similar and getting less than perfect results.

  2. Forrest says:

    No problem! This is a handy one, but it will bring surfing to a crawl unless you only enable it when you need to right click something. I’ve written several others, but they were a bit more sensitive in nature…I’m working on getting them a little more generic for public use.

    I get so much useful code around the net, its nice to be able to help someone else for a change.

Leave a Reply

Your email address will not be published.


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>