Deprecated: Assigning the return value of new by reference is deprecated in /nfsmnt/hosting2_1/2/5/2511f21f-9ae7-4244-9bb2-071fd092192e/3ice.hu/web/blog/wp-settings.php on line 472

Deprecated: Assigning the return value of new by reference is deprecated in /nfsmnt/hosting2_1/2/5/2511f21f-9ae7-4244-9bb2-071fd092192e/3ice.hu/web/blog/wp-settings.php on line 487

Deprecated: Assigning the return value of new by reference is deprecated in /nfsmnt/hosting2_1/2/5/2511f21f-9ae7-4244-9bb2-071fd092192e/3ice.hu/web/blog/wp-settings.php on line 494

Deprecated: Assigning the return value of new by reference is deprecated in /nfsmnt/hosting2_1/2/5/2511f21f-9ae7-4244-9bb2-071fd092192e/3ice.hu/web/blog/wp-settings.php on line 530

Deprecated: Assigning the return value of new by reference is deprecated in /nfsmnt/hosting2_1/2/5/2511f21f-9ae7-4244-9bb2-071fd092192e/3ice.hu/web/blog/wp-includes/cache.php on line 103

Deprecated: Assigning the return value of new by reference is deprecated in /nfsmnt/hosting2_1/2/5/2511f21f-9ae7-4244-9bb2-071fd092192e/3ice.hu/web/blog/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /nfsmnt/hosting2_1/2/5/2511f21f-9ae7-4244-9bb2-071fd092192e/3ice.hu/web/blog/wp-includes/theme.php on line 623
Javascript one-liner to Disable Right clicking on your site | Warcraft III World Editor Tutorials Map Making Help Blog

Google Translate:

Script by 3ICE.

Categories

Archives

Affiliates

  • 30Nov

    A friend asked me to write him a cross-browser right click disabler script, so here it is! Works in all popular browsers and versions. Get it here:

    <script type="text/javascript"><!--
    /* http://www.3ice.hu/blog/no-right-click/ */
    function a(){if(document.all){return false;}}function b(e){if(document.layers||(document.getElementById&!document.all)){if(e.which==2||e.which==3){return false;}}}if(document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=b;}else{document.onmouseup=b;document.oncontextmenu=a;}document.oncontextmenu=new Function("return false")
    // –></script>

    Right click disabler scripts will only protect you from really stupid users. Even my grandmother knows how to download the page source from the View menu, and then everything can be extracted by reading it.

    This goes into the head section! Just copy it there and it will automatically work.

    DEMO: compact or full versions. If you can't download from here by copy pasting, go to the demo and copy from there. (The two versions are identical, but the full is not obfuscated.)

    Posted by 3ICE @ 5:06 am

One Response

WP_Cloudy
  • 3ICE Says:

    Update: Added full version, which is exactly how the compact version looked before obfuscating. (So the two versions have the same functionality, but compact takes up less space and is harder to read by humans.)
    I suggest getting the compact version for your website and the full version if you want to see and learn how no-right-click scripts work.

Leave a Comment

Please note: If you post more than 5 URLs, then automated moderation will delay your comment for investigation. There is no need to resubmit the comment as it will be approved if found to be appropriate.