How enable google chrome browser to run local commands in Windows? - javascript

I am using a web development tool called Oracle APEX 21.1 to create an app which will run on the web for some users and as desktop app for other users. The application runs in a browser in both cases. My problem is with the users that will use it as a desktop app. Sometimes I need to run a local file or run a specific program from the computer the user uses to run the app. The user is instructed to use google chrome to use the app. My question is, is there a setting of google chrome that I can set to allow my app to access local files or run Windows commands? Is there any other way i.e an add-on? If not, is there any other browser that can do the job? P.S: In my app, I can make use of JavaScript, JQuery, Oracle PL/SQL. Of course, a browser simple setting to set is the best option for me, if any.

in browser you you have to do use "href" string like this :
window.location = "notes:///server/file";
"notes:///" program name
And "server/file" parameter for programe

Related

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.

How to use the browser as the GUI for an offline application?

I want to be able to create an offline program that can use the browser as GUI. I'm not particularly good at GUI programming in general, and overall it seems that using HTML and CSS to structure a GUI would be the easiest.
Cross browser method is preferred, but I will most likely use Google Chrome
I need to be able to open an external program, possibly with command line arguments
Javascript seems like the best language for this, however as far as I know it isn't possible to launch programs with it.
This is on Windows 7.
That's a good idea and is done by a several popular softwares.
The best way is to make your offline program run a web server that the browser will be able to access.
ie: Your program starts a web server on localhost:5555 and then you'll be able to request http://localhost:5555/users in Javascript, from your browser.
Another approach could be using a UI framework like AngularJS + local storage. I'm working on an app right now that will be used online (connected to the web), online locally (connected to a local server that is not connected to the web), and offline.
You could build a single-page web app and let Angular manage all the "urls".

upload chrome extension to store including native application

I have my first brand new google chrome extension, which I'd like to upload to the chrome web store. The thing is that my extension is using native messaging via stdio to a c++ exe. The extension also required a registry key to be installed.
Is it possible to upload the required files to the chrome web store (including exe and dll dependency)? Is there a way to automate the installation of the registry key (required to send messages from chrome extension js to exe), and register dll?
The idea behind chrome-extensions (and native messaging) is to limit the giant security hole that is NPAPI: to create a divide between the browser and the desktop that runs it. For this reason, you'll need to perform two separate installations: one for the extension and another for the native code.
To the best of my knowledge, you can't bundle the binary with the extension. But you might be able to (partially) do it the other way around: have the native code also install the extension:
There is a way to partially automate the process of installing the extension: you can pre-load the extension via the registry. This only applies to extensions on the chrome web-store (CWS). I believe this requires to reboot chrome. And of course the user is notified that an extension was installed. see here - https://developer.chrome.com/extensions/external_extensions
There's also something called "inline installation" - not quite "automatic", but this should make it easier for your users to install the extension from "within" your site (as opposed to the CWS). The extension still needs to be hosted on the CWS, but the user needs not navigate there.
see here - https://developer.chrome.com/webstore/inline_installation (and especially the line section - about verified site - which requires that you register your site with Google - and thus may render this technique useless to you)

Javascript : Run client side EXE by CHROME [duplicate]

My requirement is to launch my installed application from chrome browser if it is installed on client machine, If not installed then I wanted to start download. What is best recommended solution for chrome?
So fare i tried following
used NPAPI, but due to deprecation of NPAPI by chrome I can't use.
Checked PNacl and Pepper API both API not providing access to local file system to launch an application. They just port my C/C++ code in browser and run it in browser environment with sandbox restrictions.
Is it true only option i have is to use native messaging? Or is there any other option for simple task to launch my application from our url,
Regarding “Native Messaging”
Do users need to install my extension
Do i need to add my extension to chrome store
How to deal with Registry permissions for non admin users
Can i install extension to chrome along with my app installation
Note :- Found some providers use “External Protocol Request” to launch application but there are no enough resources where can i found more about this
Thanks and Regards,
Pravin
For what its worth,
see here - http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/nativeMessaging/
the README indicates that Native Messaging can now be added even by non-Admins.
But it appears Native Messaging will only work for Extensions: "Extensions can exchange messages with native applications(...)" and I dont imagine you can expect all of your users to do that.
To open it if it's installed you just need to register your application (at the OS level, so the details will vary by OS; you don't say what OS you are targeting) as a handler for some specific scheme, then have your page open that scheme. That's the same flow that causes mailto: links to open a user's mail client, for instance.
If you have a chrome app, you can use inline install: https://developer.chrome.com/webstore/inline_installation

What is the best way for a website to check if a user has installed a client app?

Let's say I've got a website that works better if a client has installed and logged into a desktop application. I'd like to be able to do 2 things:
Alter the website if they haven't installed the app (to make it easy for them to find a link to the installer)
If they've installed the app on a couple of machines, determine which machine they are browsing from
I'd like something that works on Windows and OSX, on any of the major browsers. Linux is a bonus.
A few thoughts:
Websites can detect if you've got Flash installed. How does that work and could it be used for both of my goals?
Could I just let the client serve HTTP on localhost and do some javascript requests to fetch a local ID? I know google desktop search did something like this at one point. Is this a standard practice?
Thanks!
You can register a protocol from your desktop application (see this). This can be used, for example, to open your desktop application with arbitrary data from the website. You could then have your desktop app send a HTTP request to your webserver, telling it what machine you are on.
You can have a browser plugin (activex for IE or Netscape plugin for the rest of the browsers) that can communicate with the application. When the webpage is loaded, it can try to instantiate the plugin and if it succeeded, it can use it as a proxy to the application. If it fails, then either the app is not installed or the plugin was explictly disabled by the user. Either way, your website should degrade its functionality accordingly.
Update: Forgot to answer your questions:
Flash does it exactly this way. Flash is a browser plugin that is created by the web pages.
You can have a machine ID generated at the application/plugin install time and your plugin can pass that machine ID to the webpage when it is created.
On the topic of using local webserver:
I would stay away from having a local webserver, mainly because of security considerations. It takes quite a lot of work to make sure your local webserver is locked down sufficiently and there are no XSS vulnerabilities that other malicious websites can exploit to make it do stuff on their behalf.
Plus, having a webserver means that either it has to run as a system-wide process, or if it runs as the user, you can have the website interact with only one user's instance of the application, even though multiple users can be logged on and running it at the same time.
Google Desktop Search suffered from both the XSS security vulnerability (though they fixed it) and the limitation of only one user being able to use it on a machine (I don't know if they fixed this one yet, though chances are they did).
Websites can detect if you've got Flash installed.
Actually, I believe a browser can detect if you have the Flash plugin for the browser installed, and webpages can offer "installed" and "uninstalled" option that the browser can choose.
Otherwise, you are asking for a means, by putting some code in a webpage, of being able to analyze a user's home computer, and report what it learned to you website.
Can you say Major Security Hole?
If you can pick a development environment for the desktop app, then check out AIR from Adobe. It lets you develop desktop applications using either html/javascript, Flash, or Flex.
It has API calls you can use from a browser based flash app to see if the desktop based AIR app is installed, what version, etc. You can even launch it and pass parameters from the web app to the desktop app.
http://www.rogue-development.com/blog2/2008/03/interacting-with-an-air-app-from-a-browser-based-app/
Websites can detect if you've got Flash installed. How does that work and could it be used for both of my goals?
it's quite a bit simple, your browser tries to render some additional files, with some specific formats such as flash .swf and I the browser doesn't find installation, then will be start downloading, or you will get the option to download that program.
Flash also uses AC_RunActiveContent.js please take a look at this js, people usually put this on their webpages
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave cabs/flash swflash.cab#version=8,0,0,0','width','981','height','635','id','build5','align','middle','src','build5','quality','high','bgcolor','#ffffff','name','build5','allowscriptaccess','sameDomain','allowfullscreen','false','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','build5' ); //end AC code
}

Categories