Process of appjs "deskshell"?

205 views
Skip to first unread message

Kevin Ingwersen

unread,
Sep 19, 2013, 6:08:36 AM9/19/13
to appj...@googlegroups.com
Hey there.

I just wanted to ask into the wild, what the process of the new appjs is? :)

Regards, Ingwie

sihorton

unread,
Sep 19, 2013, 10:26:55 AM9/19/13
to appj...@googlegroups.com, ingwi...@googlemail.com
Hi Ingwie,

I have not heard anything at all. It sounded like all that was needed was that the original bridge code should be removed and then the project re-compiled (to get all of the web rtc and new goodness in). However I have not heard anything more.

I was thinking lets take up my original idea again, i.e. download chrome and then control it from our application script using the debug interface we have implemented. If we do that and try to make the apps as good as possible then we can re-use all of that knowledge when the new version of appjs lands.

Everyone is welcome to have a bash at implementing something so we can take the best ideas and combine them all.

/Simon

Ægir Örn Símonarson

unread,
Sep 19, 2013, 2:02:35 PM9/19/13
to appj...@googlegroups.com
Simon, 

I think your plan to use a standard Chrome as the base is an excellent idea. Then we  have a base to work on. I guess we can just swap it out when and if we get some thing better.

I for one am waiting to  git repo to emerge so that I can take a look at the code and see how I can contribute.

Do you have any plans on pushing this to github?

Kveðja,
Ægir Örn Símonarson

Hugbúnaðarsérfræðingur.

Sími: 822-3325



--
You received this message because you are subscribed to the Google Groups "appjs-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appjs-dev+...@googlegroups.com.
To post to this group, send email to appj...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Simon Horton

unread,
Sep 19, 2013, 2:09:17 PM9/19/13
to appj...@googlegroups.com
Hi Ægir

Yes this will all be open development. Github project is here: https://github.com/sihorton/appjs-deskshell, empty currently but with a cool icon to start us off.

We should aim to cover windows, mac and linux and then also the possibility of different "backends" - nodejs and php definitely and then others as developers volunteer. I will try to figure out a usable structure and then produce a very simple initial setup so others can jump in and begin hacking.

/Simon

Ægir Örn Símonarson

unread,
Sep 19, 2013, 2:26:30 PM9/19/13
to appj...@googlegroups.com
Nice, 

Whould you be willing to push a prototype of what you have to brance cald prototype or a sepperate repo appjs-deskshell-prototype.


Just so that I can see how you boot the thing upp with the debugin protocol.
This would just be somthing to play with and see how this works.
 


Kveðja,
Ægir Örn Símonarson

Hugbúnaðarsérfræðingur.

Sími: 822-3325



Simon Horton

unread,
Sep 19, 2013, 2:37:33 PM9/19/13
to appj...@googlegroups.com
Sure no problem. If you want to hack something now and are ok with nodejs then:-

npm install chrome-rdebug

This implements the full debugging protocol and there is a file "demo1.js" that has example code and a description of how to get going.

I am having a first crack at creating an appjs like hello world application at the moment. This will target windows first and be very basic but I will push to https://github.com/sihorton/appjs-deskshell as soon as it is usable.

/Simon

Simon Horton

unread,
Sep 19, 2013, 3:37:22 PM9/19/13
to appj...@googlegroups.com
Ok, I just put together a full proof of concept for windows. This is extremely basic but it illustrates launching chrome, connecting with remote debug and then controlling the window. It navigates the chrome window to appjs.com and then to about:blank after 5 seconds.

You can check out the project from github but this does not include any binaries. You can download everything including the binaries from this link: http://appjs.delightfulsoftware.com/deskshell/deskshell-nodejs-win.zip (67 meg)

It currently uses a bat file to launch everything, always uses the same port number and does not do anything really useful yet. However it does prove the concept, you can create a little app and it can control chrome.

This is a start that can only get better!

Ægir Örn Símonarson

unread,
Sep 19, 2013, 4:30:16 PM9/19/13
to appj...@googlegroups.com
Thanks,

I'm Downloading it now.

Kveðja,
Ægir Örn Símonarson

Hugbúnaðarsérfræðingur.

Sími: 822-3325



Simon Horton

unread,
Sep 19, 2013, 5:26:29 PM9/19/13
to appj...@googlegroups.com
I have been playing around and have made a new more featured demo app "nodejs-demo1". This has the following features:
  • freeport module used so that unlimited numbers of apps can be run side by side.
  • application now launched from an app.nsr script, in windows associate ".nsr" with nodejs and then clicking on the file will launch the application.
  • app.nsr script launches the node binary itself so in the future we can pass in application parameters easily.
  • A very basic webserver is provided that serves files from the content directory
  • Remote debug interface is opened so the application can control chrome
  • Socket is also opened by app.nsr, the client web app can then open a socket and send and receive messages.
I have uploaded a new version of the zip (with the same filename) since I added a number of node_modules for this application which are useful for all applications to use.

Hopefully the original application shows the bare bones that could be implemented in other languages (e.g. for the php port). This new application should show the various ways to communicate from the app to the server.

I did not have success passing the parameters to chrome, I think this is because it is a portable application and so the parameters are not supported, more research on this issue is needed.

I have tried to add readme files and document things a little but I am sure much better documentation is needed.

Have a poke around and try creating your own apps and fix the obvious missing functionality and flaws!

/Simon

Simon Horton

unread,
Sep 19, 2013, 6:47:33 PM9/19/13
to appj...@googlegroups.com
I have now taken the code from nodejs-demo1 and created a deskshell-api module. This provides an api to simplify the applications themselves. I created a demo app "nodejs-deskshell-api" that demonstrates the new api:


/**
* this demo shows usage of a deskshell api.
*/
var platformModulesDir = "../../bin/win/node_modules/";
var deskShell = require(platformModulesDir + "/deskshell-api").api;

deskShell.startApp({
htdocs:'/content'               //folder to serve files from, remove property to disable httpServer
,openSocket:true             //opens a socket for client application to connect to in order to send / recieve messages
,launchChromium:true      //launches the browser
           ,port:8086                    //optional hardcode the http port 
 ,cport:8087                   //optional hardcode the chrome debug port
 ,chromiumPath:'..path_to_chromium_binary'  //optional provide path to different chromium binary.
})

The startApp function returns a promise that is fulfilled once the application is running, so you can use it like this:-

.then(function(app) {
//app.socketio holds the socket that can recieve and send messages to the client.
app.socketio.on('connection', function(socket) {
console.log("connected to client");
socket.on('Hello',function(params,back) {
console.log("hello called");
socket.emit("alert",{mess:"hello from backend!"});
});
socket.on('controlMe',function(params,back) {
console.log("controlMe message recieved");
app.rDebugApi.pageNavigate("http://appjs.com");
});
});
});

This uses the the socket to send an alert message to the client if it gets the Hello message. It changes the page that the client is on when it receives the "controlMe" message.

Well this is still early days but it feels like we have really come a long way already. We now have a basic api and can communicate with an application that we launch in a browser. Source for the api is available on github: https://github.com/sihorton/deskshell-api and npm (npm install deskshell-api).

I have packaged the example applications, node_modules and binaries into a zip download for windows: http://appjs.delightfulsoftware.com/deskshell/deskshell-nodejs-win.zip

/Simon
Reply all
Reply to author
Forward
0 new messages