SitePoint Sponsor

User Tag List

Results 1 to 19 of 19

Thread: Ctrl+N

  1. #1
    SitePoint Member
    Join Date
    Jun 2004
    Location
    somewere
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Ctrl+N

    Hi,

    On my site i have loads of people trying to copy my site, for some reason, by doin file edit using ms frontpage. So i've managed to do an enter page and then go onto the homepage with only scroll bar and border line no toolbars. But when pressing ctrl+n they can open a new window with a toolbar. Is There any way to disable ctrl or disable the edit button as with on this site?

    Thx


    Flubber

  2. #2
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I have to ask this - how do you know that someone is copying your site using ms frontpage???

    Frontpage isn't a browser, so how can you be detecting this?

  3. #3
    SitePoint Member
    Join Date
    Jun 2004
    Location
    somewere
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi i mean as in they use ie 6 or something and then choose frontpage to edit it or dreamweaver etc. On my trial website i discovered that nearly half the people who knew the site did this and put stuff on their site. They then claim the scripts etc. was theres and get more people visitng their site.

    I know this doesnt make much sense but anyways any help?


    Thx

    Flubber

  4. #4
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Let me save you the time.

    YOU CAN'T STOP PEOPLE FROM TAKING YOUR HTML SOURCE CODE.*

    Approach this problem legally, because there is no technical solution.

    *Yes, I really mean it. **

    ** Don't ask, "But what if...?" Thousands that came before you have tried and failed. This can't be done. Period.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  5. #5
    SitePoint Member
    Join Date
    Jun 2004
    Location
    somewere
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the people trying to get out my site dont know about html code and if i were to disable ctrl+n they couldnt anyways.


    Thx


    Flubber

  6. #6
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't do it anyways - accelerator keys (ctrl+something) are interpreted by the browser before they are sent as events to the webpage. So, you could detect that somene used ctrl+n, but there's nothing you can do about it.

    Like I said. Pursue a legal recourse - you have no technical ones.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  7. #7
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    beetle: Actually that's not 100% true. There are ways to cancel almost any key in a browser (atleast IE and Moz) including ctrl+p, ctrl+r, ctrl+n, F1, F5, and more

    There are some commands that are not cancellable (atleast I haven't found a way to cancel them), like Alt +F4 or ctrl+alt+del

    aDog

  8. #8
    SitePoint Zealot
    Join Date
    Nov 2003
    Location
    California
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IE = Infinitely Exploitable

    One possibility (not a good one) to encrypt your HTML code (or make it not human readable)
    Google Chat Boards - unofficial Google discussion forum

  9. #9
    SitePoint Aficionado JVLB's Avatar
    Join Date
    Jan 2002
    Location
    N 44 56.537' W 123 3.683'
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did I miss something? On my browsers, Ctrl+N just creates a new window. How does that contribute to ripping source?

    Source can be viewed with the mouse and menu as easily as with key combos; once you have source view you can cut 'n' paste to your heart's delight.

    I was of the impression that event handlers can intercept most keystrokes and keystroke combinations within the browser page, but once you are in source view they would have no effect.

    Now, I expect, ActiveX is an equine of a different complexion.

  10. #10
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    adog

    show me how to cancel ctrl+n, and then I'll believe you. Until then, I stand by my statement that it's not possible to prevent the browser from carrying out its default action first.

    JVLB

    the OP mentions ctrl+n because he's forcing his site to be viewed in a popup window. This prevents the use of the menu View » Source. However, if you do ctrl+n, it will open a new (normal) window w/the current page, so View » Source becames available to the user. This is why he wants to prevent it.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  11. #11
    SitePoint Member
    Join Date
    Jun 2004
    Location
    somewere
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi, JVLB, when pressing ctrl+n on a window with just scrollbar from a link results in the toolbars appearing letting people doin file edit. I have noticed on this page it is disabled anyways. any help?

    P.S People copying my site dont know about sources yet. This is only a temporary measure to scare them off.

    Thx

    Flubber

  12. #12
    SitePoint Aficionado JVLB's Avatar
    Join Date
    Jan 2002
    Location
    N 44 56.537' W 123 3.683'
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's an axe for that fly on your friend's head:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>Untitled</title>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    html,body{height:100%;width:100%;}
    </style>
    <script type="text/javascript">
    if(navigator.appName!="Microsoft Internet Explorer"){
    document.addEventListener("keydown",ctrlIntercept,false);
    }else{
    document.attachEvent("onkeydown",ctrlIntercept);
    }

    function ctrlIntercept(e){
    if(typeof event!='undefined'){
    var pressedKey=window.event.keyCode
    }else{
    var pressedKey=e.keyCode
    }
    if (pressedKey==17)alert("Don't try it!");
    }
    </script>
    </head>
    <body>

    </body>
    </html>

    Now, let's not even talk accessibility issues.
    Last edited by JVLB; Jun 12, 2004 at 21:29.

  13. #13
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Axe? More like bulldozer.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  14. #14
    &#083;itePoint Aficionado JVLB's Avatar
    Join Date
    Jan 2002
    Location
    N 44 56.537' W 123 3.683'
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Disables Ctrl+N though, doesn't it?

    (The axe reference is from a Chinese proverb.)

  15. #15
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, it doesn't. It disables the control key. Since this breaks so many other functions of the browser, I don't even consider this a solution. Hell, it's barely a hack.

    I stand by my statement.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  16. #16
    &#083;itePoint Aficionado JVLB's Avatar
    Join Date
    Jan 2002
    Location
    N 44 56.537' W 123 3.683'
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The purpose of using the Chinese proverb allusion was to point out the unadvisability of using such a blunt tool for a relatively delicate operation. Perhaps that escaped you.

    So, you're saying Ctrl+N still opens a new window on your browser with this code applied?

    Oh, and not to put too fine a point on it, but the code doesn't actually disable the Ctrl key, it simply intercepts it. And then, only within the context of the document window on which it is applied.

    Additionally, disabling the Ctrl key was among the original design parameters suggested by Flubber. I didn't set the design parameters, I simply built to them.
    Last edited by JVLB; Jun 13, 2004 at 07:22.

  17. #17
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I'm still wondering what evidence you have that your code is being lifted and used somewhere else? Once a viewer has a browser open, they can decide to copy the code or not, with no reference to the server, just using the version currently on their machine as in normal viewing.

    Do you do a google on a line in your code that is likely to be unique?

    How can people who you say don't know html use your code? That would make it even less likely that they'd lift the code!

    I'm also interested in how you detect that they have used ctrl+n to open a new window, to do this. Or were you just worrying that they might try this?

    Can you show us your site and an example of a site that has taken your code?

  18. #18
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    And also
    "Is There any way to disable ctrl or disable the edit button as with on this site?"

    It doesn't seem disabled to me!

  19. #19
    &#083;itePoint Aficionado JVLB's Avatar
    Join Date
    Jan 2002
    Location
    N 44 56.537' W 123 3.683'
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm with Dr. John on this one. I would add that if someone is swiping your code, consider it a compliment. There is so much good code out there for the taking, if yours is prized, so much the better.

    A final note, in all likelihood a determined code swiper could easily figure a way to cop your page from their browser cache, circumventing all your browser-event blocking efforts. Simpler still, they can disable JavaScript on their browser (the cads!).
    Last edited by JVLB; Jun 13, 2004 at 08:48.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •