HTML/CSS HTML Code for Firefox to Stop Right-Click Copying

AI Thread Summary
HTML is primarily a markup language, not a coding language, and while it can embed JavaScript, it has limitations in preventing content copying. A user shared a JavaScript snippet designed to disable right-click functionality on a website, specifically for a guitar tab site, to deter casual copying. However, it was noted that determined users can bypass such measures, as browsers inherently download content. The discussion emphasized that while these scripts may deter less knowledgeable users, they are not foolproof and do not prevent users from saving entire web pages or accessing source code. Ultimately, the consensus is that while some measures can be taken to discourage copying, they are largely ineffective against those with technical skills.
MartinJH
Messages
72
Reaction score
2
I realize HTML isn't strictly a 'coding language' or so I've heard.
I have a good friend who has a site he needs to prevent users from 'right clicking and copy'.
Its a guitar tab site and he has spent relentless hours transcribing a band whos songs are far from easy. So to prevent, to a certain degree, unrightful copying he needs the code to prevent this, specifically in Firefox. So if anyone has this or a source, we both would be very grateful.
Thanks
 
Technology news on Phys.org
All sorted now.
I thought you needed to call a .js file but you can do it all within html with this code:

Code:
<SCRIPT TYPE="text/javascript">
<!--
//Disable right click script
//visit http://www.rainbow.arch.scriptmania.com/scripts/
var message="Sorry, right-click has been disabled";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
// -->
</SCRIPT>
 
You can't. There is nothing you can do to stop an industrious visitor from grabbing stuff from a site, except for not putting it up.

As for that JavaScript, NoScript will bypass that.
 
You were correct in believing that HTML is not a coding language. It bears no real relation to coding languages, it is a "markup language" that has to be interpreted by a browser. It DOES, as you found, allow embedded coding in the form of javascript.
 
MartinJH said:
All sorted now.
I thought you needed to call a .js file but you can do it all within html with this code:

Code:
<SCRIPT TYPE="text/javascript">
<!--
//Disable right click script
//visit http://www.rainbow.arch.scriptmania.com/scripts/
var message="Sorry, right-click has been disabled";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
// -->
</SCRIPT>

And how do you prevent someone from saving the entire webpage to disk ?
Like jhae said , you can go only so far to interfere into someone's browser.
The fact that the browser contains the content means that the data is already downloaded to the external party
 
GJBRKS said:
And how do you prevent someone from saving the entire webpage to disk ?
Like jhae said , you can go only so far to interfere into someone's browser.
The fact that the browser contains the content means that the data is already downloaded to the external party
I wouldn't want to waste my time trying to prevent that and has never been a thought :).This is/was not a full attempt to prevent users from unrightfully copying something I must make that clear :).
I haven't said I want to prevent users from saving the entire content, if they want to do that then who can stop them. Above, I have merely said id like to prevent it to a certain degree from users who are not knowledgeable in that aspect.
Its a small measure to reduce the amount of users from directly copying something. I realize it is a waste of time since you can view the source code and grab what you like that way.
I understand there are more script kiddies these days and people who do know what they are doing and are able to get what they want but this isn't there to hinda there progress.
 
Last edited:
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

Similar threads

Replies
4
Views
2K
Replies
6
Views
3K
Replies
9
Views
3K
Replies
15
Views
6K
Replies
3
Views
2K
Replies
5
Views
4K
Replies
2
Views
4K
Replies
6
Views
6K
Back
Top