views:

87

answers:

6

EDIT: please read the question and why I want to do it before passing judgement on this, I want to develop locally using a web browser as the interface, I KNOW its a security hole, but if there is a way for the end user to disable this security so it can be used locally I want to know, of course this isn't possible under normal circumstances as this would create a security issue

Question: I want to make some apps that run locally and just use jquery as the user interface so it would have to have access to the machine's command line, at the least, so that it can make calls to the system, I don't want to do it through a web server, in this case, as this overcomplicates it as far as permissions, etc, I want the jquery app to run more like a native app so that it can open files for the user to display to them, etc..

I am wondering if anyone knows of plugins, such as for firefox, that allow this to happen so that I could install this on my machine to make an app like this.. thanks for any info

+2  A: 

In general, browsers go to great lengths to make that impossible, because they present an immense security hole. (Consider, eg, a web page that could launch rm -rf /.)

Charlie Martin
yeah I know this and I don't know why I'm getting voted down when I clearly that I am trying to do this for local use and that a user would have to knowingly install a plugin / disable security to do this
Rick
I think the point is that if you found a way, it would be a browser bug, and a serious one.Oh, I suppose you could write something in C and invoke it -- I can think of several approaches -- but it would, in general, be a Bad Thing.If you want to build an application with a web-technology interface, give Appcelerator's Titanium Developer a look.
Charlie Martin
Ok, I understand what you mean, I just figured there might be a way for a user to knowingly disable features, which I wouldn't necessarily consider a security issue.. I don't care at all about actually using a browser, I just want to use Jquery, javascript, HTML, CSS, so if there is another way to do this and run it locally through some other app, that would be great as long as it supports both windows and linux.. I will look into what you said about appcelerator
Rick
@Charlie.. appcelerator looks really cook.. thanks!
Rick
A: 

In the browser, without a web server you could probably use VBScript (only in IE of course) to do what you're looking for - so you could potentially do "data access" type stuff in VBScript and your UI components and stuff in JQuery - I think that would be a mess though. The only other thing I can think of would require you to install a light http server on the client machines... and you could probably write an ajax wrapper to interact with the command line on the "local" web server.... I know that's not exactly what you're going for, but as far as I know I don't think you options.

Matthew J Morrison
interesting.. thanks for the info, I couldn't use this myself as I don't use windows, but it is good to know
Rick
A: 

This is something I did a long time back. I used to have a webpage(local html) displayed on my desktop as a background. I had used that to launch programs on my PC. The way I did that was using :

  • VBScripts
  • .bat files
  • I just tried, it only works with IE(checked IE 6/7). When you call a .bat or .vbs file as a file -- file:///c:\ or using local host. It will give you an option to run the file.

    VBScript Example to get your feet wet.

    DMin
    A: 

    I don't know if you can access command line, but you can read local filesystem.

    This function do this (in firefox)

    function readFile(arq) {
          netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
          var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
          file.initWithPath(arq);
    
          // open an input stream from file  
          var istream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
          istream.init(file, 0x01, 0444, 0);
          istream.QueryInterface(Components.interfaces.nsILineInputStream);
    
          var line = {}, lines = [], hasmore;  
          do {  
            hasmore = istream.readLine(line);  
            lines.push(line.value);   
          } while(hasmore);  
          istream.close();  
          return lines;
        }
    
    Topera
    Reference: http://www.mozilla.org/projects/security/components/signed-scripts.html
    Topera
    A: 

    It's been 10+ years since I've even looked at this, but HTAs might be what you're looking for.

    Andy Gaskell
    A: 

    Try one of the following:

    On Windows, you can make an HTA, which is a web page running in IE, but with Windows Script Host access levels (you can do anything).

    On a Mac, you can build an html+javascript application with Dashcode.

    Elseware (and on Mac and Windows), you can build an html+javascript application in Adobe Air.

    Seth