I will develop MVC with ASP.NET and I can run exe file on the IE browser client.
This code
MyObject = new ActiveXObject("WScript.Shell");
MyObject.Run({application path});
But I can't call it on the chrome brower. Do you have sample javascript code?
Thank you.
Be aware that alot of companys disable activex because of security reasons. And starting a program with javascript code is a bad idea (even if the browser allows it!).
Is the program related to some kind of file type? You might load a file for the program that let the browser start the application. Like downloading pdfs starts acrobat...
Related
It's been noticed by all web extension developers that Firefox is going to stop SDK support (API that allows shell execution in client side) and will only accept web extensions.
Due to above-mentioned changes, I'm trying to get a shell command executed by javascript code in Firefox's web extensions' API.
I'm dealing with a web page that executes the web extension (I solved it by using javascript events), but the real trouble is that I need to execute a shell command in the javascript main code to open client programs such as LibreOffice or a background Java code and I don't know how to achieve it.
It's also necessary to execute these shell commands on Windows, OSX and Linux.
You can't directly run a shell command but native messaging lets you exchange messages with a specific native application that could launch other applications on your extension's behalf:
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging
I'm developing a PHP project which utilizes Javascript with jquery for a number of functions (particularly authentication/api calls). The long and short of my problem is that I cannot get Javascript console logs to appear in the eclipse console. At all.
Not only this, but some of my functions work...sometimes. I'm trying to debug the cause of this, but without any form of logging occurring, it's extremely difficult.
How do I configure my Eclipse Neon PHP project to output Javascript console logs?
Edit: The project is a PHP Web Application. I'm currently running a local PHP server for the project via the php command php -S localhost:8000
The JavaScript built-in function console.log(message); logs the given message to the console in the browser window, which is accessible via the developer tools of your browser.
If you open your webapp via the built-in Eclipse browser, you do not have access to those tools, just because Eclipse is using a closed, minified browser (just like the browser widget for QT or Visual C# WinForms or even a distributed Electron app).
Using the Eclipse browser is not really helpful when trying to debug webapps, because you can't even see loading times of the pages and so on.
I need to launch an application which is installed in the client machine when the user clicks the link in the client webpage from browser. for instance like launching the Goto meeting application from the client machine when clicking the URL link if installed else providing the download link.
I tried with ActiveXobject approach which works only with IE browser.And also check with FileAPI.
In the following link they mentioned about using Asynchronous Pluggable Protocol Handler. Since I'm new to it. Can you please guide me where to start.
Launch application from a browser
About the environment. My server application is in Asp.Net MVC platform.
Thanks in advance
Since the browser prohibits you from executing anything locally I think the best way to solve your problem would be to create Chrome/Firefox extensions.
Extensions are not bound and can be executed locally.
I designed a web page which contains some javascripts, but when I'm running the page in certain browsers like internet explorer my scripts get blocke and the browsers asks for manual enabling of the script in that browser
I need java script or jquery code for enabling script run in any browser automatically. Can anyone help me please?
Thank you
It is impossible for a website to turn on JavaScript if it is disabled in the browser.
Design your site with progressive enhancement and unobtrusive JavaScript in mind.
If, by "certain browsers like internet explorer", you mean "Internet Explorer will not run my code" (as opposed to "Browsers wil JS turned off will not run my code") then you may just need to learn how to write cross-browser compatible code.
Without a specific example of code that does not work (along with the specific error messages you receive), that topic is too broad to cover on StackOverflow.
Sounds like you are running the website locally, ie opening the file not serving it from a web server. Try running a local web server or hosting your site on a free online service and as long as the browser doesn't have JavaScript disabled the messages shouldn't show up.
I need a database storage system for Javascript where the state can be maintained on the local disk.
Here comes the spanners in the works :-
It only needs to support Internet Explorer but the minimum version must be IE6
Files need to be written so they can be read in again later (upon closing and re-opening of browser)
There can be no web server (unless it's extremely easy to distribute and does not require a install) since the HTML pages will be distributed on USB.
Does anyone know of any solutions that might help here?
Have fun playing with userData. Apparently it does what you want in IE6/7
Then localStorage for IE8/9
Or you can use the heavier store.js which does the feature detection for you and apparently works in IE6+.
It should work in IE9 but no garantuees. I would recommend store.js as it's easier for maintenance and just works out of the box. You can also support other browsers that way.
I don't know if it's supported in IE6, but JScript appears to have some level of support for this through FileSystemObject.
var fso = new ActiveXObject("Scripting.FileSystemObject");
var a = fso.CreateTextFile("c:\\testfile.txt", true);
a.WriteLine("This is a test.");
a.Close();
According to Write binary data with FileSystemObject write(), ADODB.Stream appears to be an alternative.
For strictly local IE work use HTA Applications. Then you can access local resources (text files, ADO databases) without security problems.
try to read this post: Read/write to file using jQuery
Hope this helps.
I would suggest that you not try to read/write using JavaScript but instead head down the road of embedding a small web server on the USB drive. I did this for an app once and it worked out well. I used the Cassini web server.
I created two projects in visual studio. First, I created an ASP.Net web site to read/write from an SQLite database. This site displayed all my content and was built just like any other ASP.Net site. Second, I created a Windows Forms application that hosted the Cassini web server and presented the user with a form that contained a single web browser control. This made the user experience very simple ... they just clicked MYAPP.EXE from the root of the USB drive and the form opens, starts the web server, and navigates the browser control to the start page of the web site.