Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question protect js-file from being downloaded

    I want to know if it's possible to protect a js-file from being downloaded.

    I've got a website that includes 3 js-files. If someone looks into the code and then enters the path of the included js-files. the js-files can be downloaded.

    I've seen on several site that they protect their code by calling it in a differend why something like this:

    Code:
    <script language="Javascript" src="/test1/test.js.php?837383034383738343ff4687146f4126ff1234797" type="text/javascript">
    
    <script language="Javascript" src="/test1/test.js.asp?837383034383738343ff4687146f4126ff1234797" type="text/javascript">
    so the file cannot be downloaded anymore and the client cannot see the javascript code, but can excecute it.

    does anyone know this is done. Or how to protect the files in an other way

  2. #2
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72 W. 48' 57" , 41 N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    what that's doing, is using a server side script to output the javascript, only on demand. and it's not really protecting their javascript; it's giving them a false sense of security. without doing anything fancy, like going into the cache, i can get that javascript file on my desktop.

    here's how: File > Save As > Web Page, complete.

    there is no way to protect your files frome being downloaded. in order for them to be displayed on the computer, they have to be downloaded to the computer.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  3. #3
    New Coder
    Join Date
    Nov 2002
    Location
    Netherlands
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by joh6nn
    here's how: File > Save As > Web Page, complete.
    No need for that just look inside 'temporary Internet files'

    What's so special about your script, how much did you really make youself, how originall is it, you don't want others to copy it? //--> I for one, cannot imagine it is.

    And if it is : why not letting / granting others to learn?

    All those who do NOT want thigs to be copied: don't publish it

  4. #4
    New Coder
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i made about 80-90 % of the myself

    But it's not so special i just tought maybe there is a simple why to protect it. So that just like asp and php the code cannot be seen.

  5. #5
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well all my scripts are coded by my humble self, and I try to keep them secret - at least while I am developing them.

    The final version will be parsed and compressed, and maybe obfuscated if I can, but I am seriously thinking about publishing them with some tutorials of how I did the stuff. I know people would learn from it, the only thing is, you have to finish the stuff before you can publish it

    At the moment, I have a number of APIs:

    - Array extensions
    - Dynamic layers
    - Animation plugin for the dynamic layers (multi-threaded!)
    - Core functions including mouse handling and drag-drop support, and keychecking/validation

    The above are virtually finished. I continue to develop them as I create my widgets:

    - Scrollbar (finished)
    - Slider (almost finished)
    - Scrollbox (finished)

    ...and the ones I will be doing after that include combo boxes, checklist boxes, rich text boxes etc.

    This is part of the latest project I am working on, which I started two weeks ago and had to create this stuff from scratch. (I also had a week off for my birthday ) Within the next month, all the widgets will be finished, and I will start work on a dynamic data object, and then build my application. So I guess I will be ready to publish this stuff at around xmas, but will have no time to write tutorials until about March at least.

    This all depends on whether people would be interested or not. (IE 5.5+ only!)

    ...would you? Let me know if so.

    ::] krycek [::

    EDIT: I have decided to post this as a new thread, with a poll. Please vote!
    Last edited by krycek; Nov 8th, 2002 at 02:01 PM.
    ithium | SOAPI | SDP | PTPScript manual
    "ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."

  6. #6
    New Coder
    Join Date
    Nov 2002
    Location
    Netherlands
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [off-topic]Referring to your poll was too much code for you krycek? LOL Sorry: couldnot resist 'this' answering

  7. #7
    Regular Coder
    Join Date
    Jun 2002
    Posts
    185
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The source code for ASP and PHP files can't be seen because, unlike HTML files, the web server just send a copy of the file to the browser.

    When a browser requests a file from the web server, the server looks at the file extension. If it's .asp or .php (or some other special one it's configured to look for) it loads up some designated program to read and execute that script file. The output of that file is what gets sent back to the browser. In other words, it's run on the server, not the browser.

    For static files like .html, .gif, .jpg, etc., the web server just sends a copy of the file to the browser.

    As pointed out in the other posts, .js files contain code that need to be run on the browser. So you have to send a copy of the file to the browser. If the browser can't download it, it can't execute it.

  8. #8
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Membie
    [off-topic]Referring to your poll was too much code for you krycek? LOL Sorry: couldnot resist 'this' answering
    LOL Yeah, sorry!

    ::] krycek [::
    ithium | SOAPI | SDP | PTPScript manual
    "ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."


 

Posting Permissions

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