rogerio Posted April 22, 2010 Share Posted April 22, 2010 This will execute in a Windows Sidebar gadget but not in a browser, why? function Hibernate() { System.Shell.execute('powercfg', '-H ON') pausecomp(500); System.Shell.execute('rundll32.exe', 'powrprof.dll,SetSuspendState'); } Link to comment Share on other sites More sharing options...
Greywacke Posted April 22, 2010 Share Posted April 22, 2010 i believe that's because it's explorer integrated, ie inherits the execution rights of the parent window.i doubt you would be able to do this in internet explorer however. it's basically pc hijacking if a webpage can shut down or hybernate a pc.nevermind browser hijacking! Link to comment Share on other sites More sharing options...
Synook Posted April 23, 2010 Share Posted April 23, 2010 Yes - JavaScript doesn't have an inherent security model and relies on implementing systems to have one. Browsers don't allow you to run programs arbitrarily for security reasons, therefore they do not expose (or even implement) the System object. Link to comment Share on other sites More sharing options...
rogerio Posted April 23, 2010 Author Share Posted April 23, 2010 Thanks for the replies, I did not realize that the security would prevent the rights on the machine it was running on, but I guess it makes sense in that it would increase the possibility of attacks. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.