Run GUI app from php/web page - javascript

I want to create an application running in my browser, using php, html and javascript/JQuery.
And my question is how to can I run some gui app, and/or user input require application?
I try in php shell_exec(), exec(), and system(), and it dosn't work for me
From example I want to run something like gnome-terminal -e ssh user#host or 'firefox google.com'
I know that is some method to do that in Windows OS, but my application is designed for Linux users
Is any method in php / javascript / html to run app in that way? Or should I use some other web developing language to achieve my task?
Edit: I want to add that this web app is designed to run localy (127.0.0.1), not over the web. And i only want to run applications only on the local machine where the app is hosted.

Related

How To Run a Flutter Web Application Offline?

I got a problematic assignment from my employers.
I was given the task of developing simple software that will run strictly on Google Chrome,
without attempting to connect to the web (Security reasons).
I know flutter development and I feel comfortable with the sdk.
How should I develop a web app that can be deployed using a usb stick?
Looks like PWA can be an option, but the documentation is lacking in detail.
The system does not have the ability to run a local web server.
The Flutter app must be able to work with JS libraries, I intend to use jsQR.
service workers and indexedDB could help you for develop offline route app and offline api.
mdn docs for service workers
I'm not sure that this will fit your particular case: you say that the system can't run a local webserver, but what if you provide the webserver along with your software?
I just discovered get_server: you can find it here. It aims to allow developers to host their own HTTP server by using only flutter, without resorting to external tools or other coding/scripting languages. It allows also (and that's the relevant part) to wrap your flutter web app and make it run on local network.
For now I only tried with a very simple example, but it seems to be working. These are the steps I took:
create a new flutter project: since I needed the webserver to run on Windows, I had to get flutter ready for that (see here for help)
add get_server to the new pubspec.yaml
run flutter build web on your flutter web project, and copy the build/web output
folder in the root folder of the new project (I renamed the folder while copying since flutter might change the content of the web folder)
delete all the content of lib/main.dart
paste this (this the actual content of main.dart)
import 'package:get_server/get_server.dart' as gs;
void main() {
gs.runApp(
gs.GetServerApp(home: gs.FolderWidget('folderName')),
);
}
folderName is the name of the renamed folder containing the flutter web app build.
I ran this on Windows 'device' from AndroidStudio, and my original flutter web app was reachable at localhost:8080 (for now I just used the default options of get_server). I also got the webserver (empty) GUI as a white window: I guess that can be useful for some information regarding the server itself, although, if that windows closes, localhost:8080 becomes unavailable.
But, once released, you should be able to just run the executable from the USB stick, and then connect to it with Chrome.
PS: after some time using GetServer, I had to switch to other packages because of not-so-good docs and support. Now I'm using shelf, but also Alfred is a notable mention.

Equivalent of pyinstaller for freezing python,html, and javascript

I want to create a web app which I don't want to host but keep it on localhost itself similarly to a Desktop application. Basically I want an icon on the Desktop which will open the application on the localhost . The application is developed using HTML,CSS,Javascript and flask framework of python. Pyinstaller is a way to do this but it doesn't support JavaScript and I have lots of that in my app. Is it possible?
Thanks
You could make a script that first starts the flask webapp on localhost and then starts a webbrowser at localhost:5000
Just a commentary (I hope it helps):
I created a slideshow in wordpress localhost.
I froze it with webcopy.
Install in any pc with innosetup
best

run windows application at client side from aspx.cs

I have windows application in c#.that is installed for client . I need run that window application from client side when user button click in asp.net web application
Explanation
I have task that scan hard copy from scanner . I developed web application in asp.net c#. I have search in Google to do this so many peoples are saying that is not possible due to permissions. so I developed windows application when I run that window application(c#) it scan the hard copy from scanner this window application run in background so I need to run this window application. when user button click in asp.net web application
You cannot run applications from a website on client's machine due to security & permissions.
However, your website probably can communicate with the scanner. Check this detailed answer.
While you cannot run the application from the browser, there is another option, if your application is already running in the background. Then you can make it listen to some local port and then ask the browser to redirect to the URL (consisting of localhost and that port, e.g. http://localhost:34554), so the application would receive an HTTP request and will know it needs to become active / show its window / etc. Using this technique, you could even pass some parameters to your application using query params in the URL.
Another option that allows you kinda run an application from the browser is Microsoft ClickOnce - it is just a simplified way of installing and running an application without the need for the user to download and manually run the installer.

android app with apache cordova

I'm developing a web app using HTML5,CSS3 and JavaScript.
Then I want to use the Apache ordova platform to generate a native android app from my web app but I still don't understand what do I need for this,specially do I need a server-side development with php for example??
First off i suggest you read this
Pretty much your app will be able to accomplish a little bit more than what you would be able to do in a browser if all you had available was the ability to write html/js*.
*by this i mean that you have access to device-specific hardware which is not available in a browser and a few more things but pretty much that's it.
You will need to install node.js (or io.js), then install cordova through npm, and make sure you have the Android SDK installed. Once you create your project, your html/css/js will be wrapped into a native webview component, you do not need any server to render it, effectively your app is a native app that can be installed from google play.
You will need a server, typically a RESTful API, if your app needs to query data remotely or persist to some third party. If you are thinking through a classic MVC mindset (render a page through some php code) then you probably need to read about cordova and how it works. A cordova app is a client-side only app, no server-side processing is possible unless through a network communication to a server you have access to on the internet. You can do persistence locally (to the android device) and even use a local database, but remember that this db exists on the device, so you won't be able to share information between users unless you somehow coordinate that through your app (and most likely a server-side app / rest api).
It is unlikely that your existing web app can be wrapped into a cordova app straight away, cordova apps are single page apps mostly.

Distribute cocoa app with meteor.js

Does anyone know if it is possible (and if so, how) to distribute a cocoa application with meteor.js and rendering it through a webview?
What I mean is that I want to launch a meteor server (or node.js) insied of my cocoa application and then with a cocoa webView show the content of what the meteor server is generating.
So the question is how to get meteor/node to be distributed together with the cocoa application so that the user doesn't have to manually install it.
You could embed a compressed archive of the server inside the application package (using copy files build phase of Xcode), and during app startup, unarchive/install/start it possibly using a combination of NSBundle/NSFileManager/NSTask apis. Your app can then view the served pages in a web view using something like http:127.0.0.1:YOUR_PORT/YOUR_APP_DIR.
I am assuming you are not providing your users with a installer (.pkg) since in that case, your installer script would be the take care of the installation part.
It's pretty ambitious, but you could try
https://github.com/rogerwang/node-webkit
http://jsapp.us/
http://browserver.org/
https://github.com/rogerwang/node-webkit
http://iceddev.github.com/blog/2012/11/05/node-js-in-chrome/
Check out Could Node.js run client side in Chrome with its native client (to be released soon) for some of the commentary. Meteor is built on top of node. Mongo I think would be the sticking point.

Categories