Why?

After writing articles on (HackingPassion.com)[https://hackingpassion.com] for some time, I noticed that articles were regularly copied and posted as if they had written it themselves. But really everything, even with a photo. I was asked several times or even threatened to remove my own content. They even stood on Medium. With photos of my terminal and my own face on it. (Most of those articles have been removed)

HackingPassion.com is a Word Press website, and as many of you already know, WordPress is not the safest option, and in addition, you often have to bend over backward to maintain some speed.

To make a long story a little shorter, I am also thinking of making HackingPassion a static website as well, and therefore these scripts.

Now you may think, Jolanda you are completely wrong because it is still copyable.

Right!

But it does create more hurdles to overcome. And I am convinced that only real nOObs do this copy thing, and now they hopefully don’t know “how-to”.


Here are the simple codes I used for this website to avoid this. To be clear, I didn’t make this code up, but just took it from the internet.

Disable Right Clicking JavaScript

The JavaScript code below can you use to prevent anyone from right-clicking on your page. The idea is to capture the onContextMenu event and return false in the event handler. This will block all access to the context menu from mouse right-click as well from the keyboard.

I put this JS code in my main.js

document.oncontextmenu = new Function("return false;");

Disable Text Selection CSS

Prevent text selection of a element in all major browsers. We can disable text selection using this CSS styling, user-select solves the purpose.

/* Prevent text selection of a <body> element in all major browsers */
body {
  -youbkit-touch-callout: none; /* iOS Safari */
  -youbkit-user-select: none;  /* Chrome 6.0+, Safari 3.1+, Edge & Opera 15+ */
  -khtml-user-select: none;   /* Konqueror HTML */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;    /* IE 10+ and Edge */
  user-select: none;      /* Non-prefixed version,
			currently supported by Chrome and Opera and Firefox*/
}