javascriptnode.jsbrowserchromiumappjs

AppJs as Browser


i have recently developped a Web Application running on node.js available online on nodejitsu. Now my client wants to have a standalone Desktop Application and my thoughts were on AppJS. So the question now is, is there a way on using AppJS as a "Browser" since its based on Chromium. This would be neat, because the complete App Logic and the Frontend is on the Server, so I don't have to do more than just refer the AppJS to the URL. The DesktopApp Feeling would be serverd and a navigation is all within the Frontend. No needs of back and forward browser buttons or adressbar.

So much for the goal. I tried this simply by redirecting the AppJS index.html to my server URL. And the first site showed fine, but as i tried to log in, this error encountered:

app.sh: line 4:  1734 Bus error: 10           $basedir/data/bin/node --harmony $basedir/data/app.js

Any suggestions ? Is this possible with AppJS ?


Solution

  • your question is similar to what i answered in a previous post (how to connect appjs to nodejs server and show its content). So, I'm gonna just repeat the same here with hope that it answers your need.

    Yes, it is possible to have AppJS serve as a browser for your website.

    To have you website displayed within AppJS window like a web browser, which is one of the primary intents of AppJS, you can take any one of these two (2) steps;

    1. Create an IFRAME (that fills up the width and height) in the index.html file located at "data/content/".

      Set the IFRAME SRC to your website url.

      e.g. < iframe src="http://www.YourWebsite.com">

      This will display your website in AppJS window when app.exe is started.

      NOTE: You might want to use CSS to make the iframe fill up 100% width and 100% height of the window.

    2. Change the line of code at "data/node_modules/appjs/lib/settings.js"

      FROM

      url :'ht tp://appjs',

      TO

      url: 'http://www.YourWebsite.com'

    Most of the time I opt for the first option as it allows me do a whole lot of things using CSS. And this includes placing an animated GIF at the background of the IFRAME to indicate page loading at start up.

    I go for the second option only when I want to make my actual website url a little trickier to find during an attempted hack. While still leaving the "data/content" directory and its content undeleted.

    I hope this works for you.