Is it possible to make a script that closes the browser?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Death Slaught
    Top Contributor
    • Aug 2007
    • 1137

    Is it possible to make a script that closes the browser?

    Is it possible to make a script that closes the internet browser when the user clicks,mouseove rs,or loads the page?

    Thanks, Death Slaught
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Death.

    Short answer: No. Well, maybe in Windows you can try for some kind of buffer overflow vulnerability that you could then use to execute arbitrary commands and either erase the User's hard drive or sometimes close the browser, though that would not make your script very platform-independent, now would it?

    Long answer: The most damage you can do is to close the window.

    [code=javascript]
    window.close();
    [/code]

    Comment

    • Death Slaught
      Top Contributor
      • Aug 2007
      • 1137

      #3
      Originally posted by pbmods
      Heya, Death.

      Short answer: No. Well, maybe in Windows you can try for some kind of buffer overflow vulnerability that you could then use to execute arbitrary commands and either erase the User's hard drive or sometimes close the browser, though that would not make your script very platform-independent, now would it?

      Long answer: The most damage you can do is to close the window.

      [code=javascript]
      window.close();
      [/code]
      thanks mods that should be all i need but ill probly have to pm you in a few or post again i cant get this stupid script to work but ima try a little longer before i ask for help on it.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Originally posted by Death Slaught
        Is it possible to make a script that closes the internet browser when the user clicks,mouseove rs,or loads the page?

        Thanks, Death Slaught
        Just asking, but why would you want to close the browser when someone clicks somewhere on the page, or just moves the mouse or, even worse, just loads the page?!

        Comment

        • Death Slaught
          Top Contributor
          • Aug 2007
          • 1137

          #5
          Originally posted by acoder
          Just asking, but why would you want to close the browser when someone clicks somewhere on the page, or just moves the mouse or, even worse, just loads the page?!
          simple if there was a glitch or they some how managed to get on a page thats not supposed to be accessed execpt by a certain person(me) it would ensure that the pages content was safe.

          Comment

          • epots9
            Recognized Expert Top Contributor
            • May 2007
            • 1352

            #6
            Originally posted by Death Slaught
            simple if there was a glitch or they some how managed to get on a page thats not supposed to be accessed execpt by a certain person(me) it would ensure that the pages content was safe.
            i don't think that will work cuz is u try to close the parent window, ie will ask u if u want this script to continue, if u say no the page will load.

            Comment

            • Death Slaught
              Top Contributor
              • Aug 2007
              • 1137

              #7
              Originally posted by epots9
              i don't think that will work cuz is u try to close the parent window, ie will ask u if u want this script to continue, if u say no the page will load.
              yea i noticed that but thanks anyways.

              Comment

              • epots9
                Recognized Expert Top Contributor
                • May 2007
                • 1352

                #8
                your best bet would be to use cookies

                Comment

                • Death Slaught
                  Top Contributor
                  • Aug 2007
                  • 1137

                  #9
                  Originally posted by epots9
                  your best bet would be to use cookies
                  ill look into it i havent even finished the javascript tutortial on w3schools yet so i dont know much well anything about the language im trying to do a few scripts with functions and if else statements for practice so i havent got to the cookie chapter but ill keep it in mind thanks.

                  Comment

                  • epots9
                    Recognized Expert Top Contributor
                    • May 2007
                    • 1352

                    #10
                    Originally posted by Death Slaught
                    ill look into it i havent even finished the javascript tutortial on w3schools yet so i dont know much well anything about the language im trying to do a few scripts with functions and if else statements for practice so i havent got to the cookie chapter but ill keep it in mind thanks.
                    oh ok, once u get there i think u'll want to use them too. Always remember to take your time when your learning something new ;)

                    Comment

                    • acoder
                      Recognized Expert MVP
                      • Nov 2006
                      • 16032

                      #11
                      Originally posted by Death Slaught
                      simple if there was a glitch or they some how managed to get on a page thats not supposed to be accessed execpt by a certain person(me) it would ensure that the pages content was safe.
                      It wouldn't ensure that the pages' contents were safe.

                      The only way to ensure that is not to allow them to get onto the page in the first place and that's only possible using a server-side language.

                      Comment

                      Working...