I have developed a chrome extension which does particular job and tries to connect back to a java desktop application.
Now what I want is, the chrome extension should get enabled only when desktop(java) application is opened and similarly it should get disabled whenever I close the desktop application.
Can I manage this using java?
Or any other way/ CMD is it possible?
Basically, you would need some ways to exchange message between extensions and native apps, for this purpose, there are many optional ways, such as Native Messaging, WebSocket, or simple http server/client.
Depends on what you choose to use, the implementation details may differ. However their ideas are similar:
Start the connection from extension and keep the connection for each side
Save a flag in extension side to mark whether your extension should be enabled
Once the connection is lost, revert the flag and disable the functionality of the extension
Related
I'm trying to make a chrome extension that (among other things) can connect to a serial port specified by the user.
I already found a PWA made using node.js, it makes use of an experimental feature described here: https://wicg.github.io/serial/
I can let node launch a server and connect to it. I run the following code:
port = await navigator.serial.requestPort({});
Which opens the following dialogue for the user:
I'm not sure what the name of this type of dialogue screen is, its connected to the "view site information" icon, so I named it that in the question title. In any case, i'm trying to package this function in a chrome extension, when I run the same code however, the dialogue does not open, immediately returning as if the user had hit "cancel". I get the following error:
Uncaught (in promise) DOMException: No port selected by the user.
I was thinking maybe this sort of dialogue requires some permission to be enabled in the manifest file. I cannot change the way the port is selected since as far as I understand the relevant code lies in a black box library belonging to google.
USB and Bluetooth are not experimental. The API is supported by Chrome and Edge and have been for a few years. I have built a couple of PWAs using USB.
I am not an extension developer, so not sure of the API is exposed in that context.
There are all sorts of low level programming you need to fuss with for USB and bluetooth for that matter. But its pretty cool once you get it running :)
Also, nodejs has nothing to do with a PWA. That is a server-side platform concern.
How to open an EXE file from a Client Machine through a Web Application using Chrome?
I am able to open the EXE through Internet Explorer since I am using ActiveX Objects to open the Exe file through client side scripting. But since chrome does not support ActiveX I am unable to open the EXE from chrome. Can somebody provide an alternate way to open the exe from chrome?
I know it works if IETab addon is added to the browser for supporting ActiveX. But the client policy will not accept adding add-ons.
I am trying for a solution as such in WebEx websites where a temporary application is run once and each time it is accessed it opens in the temporary app without each time installing it.
Thanks in Advance..
Short and simple answer, NO! it's not possible just by using plain HTML5/JavaScript API, and thank god it's not possible or else the consequences would be devastating! Imagine any random website executing a file on your computer! That would be the worst security nightmare!
But, there are workarounds!
1. You can, for example, use Flash (but you shouldn't) or Silverlight but as mentioned the OP doesn't want any plugin-based solution so I guess they are not as useful.
2. Another solution would be to deploy a Desktop agent, if possible, and then communicate with it using a local Rest API and handle all the native access in that Desktop agent.
Still, the most preferred way would be to just ask your user to scan (or whatever) the document and upload it to your site.
More references can be found here
I would like to programatically start few Performance tests (like the one in Chrome Developer Tools in the tab, where you can click record button or hit Ctrl + E to capture a new recording). I want to do some performance tests in my application (on few views/subpages - it is SPA). However as I need to do them on different devices (PC, mobile phone) - I want to ask few friends to do it on their machines. But they are not programmers, so I don't want to bother them with writing any code or messing with dev tools, I just would like to send them application project and JavaScript script file. The only thing they will do is run application and that script, which will cause a performance test to be started automatically.
I wonder if Chrome Extension API (or Firefox API) expose sobe methods, or if it can be done via NodeJS (with some additional modules/libs included) - like NodeJS can get access to opened programs on Windows and capture that browser is opened with application started and then fire some event, which will start performance measurements?
Or maybe it is possible just from Dev Tools?
It would be nice if that script could also automatically save test results to JSON (like when you click right mouse button after test is finished and there are options to save and load Profile file) on device disk.
What I'm looking to do is create a script that we could place on people's desktop to reset some settings back to where I want them for internal web application?
The script will need to reset everytime a user opens and closes the browser.
As far as my knowledge says, you cannot just edit settings of a browser without attaining user's permissions. So, it will be better to write a chrome plug-in application and ask you web application users to install that first.
You can identify the plug-in status in your web application.
I am presently working on website (Java EE). One of the requirements is to not let the client to open anything else other than the browser. After a lot of search I got the following results :
Change the policy of the OS.
Write some batch/c/c++ program which will intercept all the keyboard and mouse events not letting the user open anything else.
PS : It should work on windows and IE 7 or above only. The other OS and browsers need not be considered. This software is made only for intranet, so I already have control on the client machines if I have to run something.
My question is .. is there anything else I can do which will reduce the work needed on the client side or on the program which I have to write??
This is very OS specific I'd say. Windows, I believe, has APIs related to finding open windows. You could find all open windows and close them. In your application's main loop you can detect if any windows are open then close them.
Perhaps mac and ubuntu have something similar.
This might be a good place to start looking: http://msdn.microsoft.com/en-us/library/ms633497%28VS.85%29.aspx
I have no idea how to use it though.
You'll need something more powerful than javascript to communicate with your application that is monitoring the user's desktop. You may want to look at connecting JS to Silverlight then having the client download something upon opening the browser that is also similar to silverlight or .net. Then you can have them all communicate possibly.
You can set IE to be the shell process (a registry key) instead of explorer.exe, and then run IE in kiosk mode, and then disable task manager via policy (to prevent new processes).