Call Microsoft Edge inside Hololens app? - hololens

Does anyone know is it possible to call or embed Microsoft Edge Window in your Hololens app? For example, I have my Spatial mesh rendered and I'm detecting the flat surfaces. I'd like to be able to call new Edge Window with predefined url whenever I tap on a flat surface. Is there any way to invoke Edge Window this way inside the app?
Thanks in advance.

If you are using Unity, you might be able to use Application.OpenUrl("www.google.nl"); in order to open the standard browser.
See: Unity reference OpenURL
I am not sure if this will close your application first before opening the browser, but i hope this works for you.
If it doesnt, maybe you can try starting a new process by using: System.Diagnostics.Process.Start("PathToProgram.exe");
See: MSDN Reference

You cant open Edge inside your app, you can shut down your app and let the system start edge with a given URL.
If you need to get an image from a website you can use the unity www system:
https://docs.unity3d.com/ScriptReference/WWW-texture.html

Related

Electron custom web browser with on screen keyboard

I am trying to make a custom web browser inside an electron application. Using webview (because iframe is not loading some necessary web pages) I can load a web page.
Then trying to write something into the web pageĀ“s input by clicking on the react-simple-keyboard which causes blur event, so input loses focus.
I figured out, that this approach would not work directly, so via ipc communication I am trying to resend the key button value and then set it to the window with const {keyboard} = require("#nut-tree/nut-js"); keyboard.type(args.value);
In my input, above the webview tag, it works like a charm, but I am not able to type inside the webview.
Can anyone help me to solve this problem or does anyone know a perfect solution how to use other OSK in electron app or how to open native windows osk on input focus? Thank you in advance.
I'm not sure how you'd accomplish that with this library. But you can just use Window's default on-screen-keyboard to accomplish that. Here is a link to how enable it. windows support
You should also use a BrowserView instead of a Webview, as the Webview is not guaranteed to be present in future versions and it's API is unstable.
The BrowserView doesn't work like an HTML element though and you should read the docs here.
But anyways, just use the system's default and you should be fine.
Also, if you're interested, I'm developing a web browser with Electron (in fact, I'm currently writing this using that browser) and as far as I can say, it's written pretty simply and anyone should understand most of it, so take a look if you're in trouble. But I am no expert and you shouldn't rely on my code as a standard of any kind, really.
Well, I might have just found an answer for you.
Firstly, as I mentioned, you should use a BrowserView instead of webView for your external content, and this time it is a requirement for this method to work. I would create a BrowserWindow with the controls at the top, then place a BrowserView to act as a "browser" and create another BrowserView at the bottom and load in the keyboard html file. And then, when a key is pressed on the virtual keyboard, you should send an ipc message to the main script with the information of what key was pressed(it should be done via a preload script for the OSK BrowserView). In the main script, once you recieve the ipc message (via ipcMain.on()) you should then send an input event to the BrowserView containing your external content. That's done by calling contents.sendInputEvent(Event), so it has to be a main script. Here is a link to contents.sendInputEvent(Event), BrowserView (link) and preload script as well as ipc communication (link).
As for invoking the keyboard once you click on the input element, you could probably do it with a preload script for your "browser's" BrowserView, if you can find how you can check whether the focused element is an input element or something like that, and call an ipc message to then hide or show the keyboard. (Hiding and shwoing the keyboard could be done by calling BrowserWindow.addBrowserView(BrowserView) or BrowserWindow.removeBrowserView(BrowserView). But you would have to search the documentation yourself for those methods as I can't write anymore right now. Documentation could anwser any of your questions if you search for it there.

Is it possible to embed/stream/project the live image of a native Windows window into a webpage?

In the new Microsoft Flight Simulator you can pop different cockpit displays out into their own external windows, like this:
However, none of the buttons needed to interact with the displays get "popped out" as well.
I'd like to build a web app that can embed (the continuously updating image of) one of these windows that I can surround with buttons, etc, for interaction to have, say, running on a tablet next to you.
My question is, is it possible with Node to embed the continuously updating image of a native Windows window within a webpage?
Stumbled upon the Screen Capture API. This is what I was looking for.
https://developer.mozilla.org/en-US/docs/Web/API/Screen_Capture_API

Coded UI test on RDP

I need to record the RDP connection from local machine thru coded ui testing framework (Visual Studio - coded ui project).
FYI. I have Coded UI test project in my local machine and as soon as i start recording I'm going to click on Remote desktop connection and it needs to be recorded.
I've played once with such a thing. Coded UI does not support RDP. There's no known way I've heard that you can just record actions inside of remote desktop.
If you really need to do something with Remote Desktop, you may try using OpenCv Library to visually identify screen coordinates of your controls. I've done it once. The algorithm is:
make a screenshot of UI control you want to click on;
save it inside your Coded UI project;
pass the image to the OpenCV library when the control is present on screen;
OpenCV returns you coordinates' rectangle of the control;
Perform Mouse.Click(); inside the rectangle.
If you are ready to go with such a solution and need more information, please let me know...

Get OS display enumeration via nodejs

I'm looking at AppJS as a possible candidate to build a cross-browser application. AppJS runs HTML5 content with a Chromium window with hooks to NodeJS.
Is there a NodeJS module that can give me an enumeration of displays currently active? I need to support dual-monitor setups and knowing the bounds of each display is required.
I've search the Node npm directory with no luck so far.
Update:
Based on sihorton's answer, I'm playing with a javascript approach. Browser security prohibits my first approach from working in normal Chrome, but I will try this on AppJS chromium when I get home. Code here and here.
The basic approach is running code like:
OpenWindow('http://jsbin.com/axiwad/3/','test',400,500);
and then the opened window runs:
window.moveTo(screen.width+2, 0);
setTimeout(function(){
$(".s2w").html(screen.width+2);
$(".s2h").html(screen.height);
}, 500);
The issue of course, is that browser do not allow a moveTo outside the active screen boundary. It remains to be seen if AppJS chromium fork allows this.
If you are running AppJS then you can do the screen detection using tricks in javascript running in the chromium window part of AppJS. I quick google search found the following link, I am sure there are others and if you experiment enough then hopefully you will get a cross platform solution:-
http://archive.cpradio.org/code/javascript/dual-monitors-and-windowopen/
An alternative approach if you want to stay node-native is to implement a common api and then implement separate code behind that for each platform. I don't personally know of any better solution at the moment, and obviously this is less preferable to the javascript solution above. However if you must go this route then there is node edge:
http://tjanczuk.github.io/edge
This lets you run .net code from nodejs so you should be able to cover windows machines with that api. For linux you could then look into connecting into dbus:
https://github.com/sidorares/node-dbus
https://npmjs.org/package/dbus-native
Hopefully you can find appropriate sample code on the internet to get display properties using dbus and .net and then just plug it together and go from there.

How is the panel displayed when launching Chrome Hangout extension made to be always on top and pinned?

When launching the Chrome Extension Google-Hangouts, a panel initially appears that lists members and a link/button to create a new Hangout.
This panel is initially pinned to the bottom right of the browser window. When pinned like this, it remains always on top as a browser navigation session continues: users can go to different URLs, change tabs, etc. and that panel stays at the bottom right and stays on top of all other windows (or at least on top of the main browser window).
Once it's unpinned, you can drag it around the window, but it no longer stays always on top.
My question is, how was that achieved - what code, or what functions, do i need to call to create that window/panel so that it stays initially pinned and always on top? Is there some binding to some native code that's involved? Some other approach?
If anyone know and can show or explain, i would be hugely grateful as this feature is key to an extension i'm trying to build.
Thanks a lot!
This may not be an answer but to get a clue of what is happening I extracted the crx file to view its content there are a few OS specific files : ace.dll , libace.so and ace. After researching a bit i found this. This is a plugin. Hangouts extension is using ace plugin which is actually running on your desktop(i'm not sure about this). You can check this article
I found this related post: How to build an chrome extension like Google Hangouts
ACE is actually not what makes the window, Chrome has that capability built in, apparently. Even if you don't enable panels, extensions from Google can still make them, provided your OS is capable.

Resources