I am trying to figure out how to open a new window from within my WinJS Universal Windows app.
I've found plenty of examples of how to do this in a XAML Universal App using Windows.ApplicationModel.Core.CoreApplication.CreateNewView, but I can't seem to find a reference to that method within the WinJS or Windows namespaces in my Javascript. According to code-hints when I am writing my Javascript, I am able to see that there is a Windows.ApplicationModel.Core namespace, but the only class that appears in it is AppListEntry. No CoreApplication or any of the other classes that the documentation suggests should be there.
I've been digging around trying to find out if this is possible. I haven't been able to find any resources that specifically say you can't perform this action in a WinJS app, but I haven't found any examples that show how to do this either.
I downloaded the Universal Windows App Samples, and they do have a MultipleViews project there, but it doesn't include a JS build.
Does anyone know if it is possible to open a new window from within a WinJS app?
What happens when you do:
window.open("http://www.w3schools.com");
Or set target as "_blank" as you would do for an HTML window?
Visit W3Schools
There is tool written for the Intel XDK (A Cordova product), which can work around some of the limitations of JS running on Windows. Here is a link: https://github.com/xmnboy/xdk-win8x-compat.js . It may resolve some of these issues.
When I was writing Win8 JS apps, I know that I could wrap a function in:
MSApp.execUnsafeLocalFunction(unsafeFunction);
(documentation), which would allow me to inject JS to the DOM. You may be able to write a function that creates a new window with that.
Related
I need to use InkCanvas in my web application using javascript (angular), is it possible to save InkCanvas as a SVG using javascript (or convert InCanvas to canvas)? i see this, but it seems it works for C#, i need a way to do it in javascript!
I think InkCanvas is only supported in Universal Windows Platform (UWP) for Windows10. This is confirmed in this SO post.
You can use Webassembly to run C# code in web browser using some JS helpers. Here is a post explaining the same.
You can try this with the c# code that you are interested in. Compatibility depended. These are relatively new features and only way to know is to try.
I'd like to use the awesome WebAPIs which power VsCode/electron. So, is there a way to use VsCode for, say, playing audio from the local disk?
A VSCode extension does not have access to editor's DOM or web specific APIs. Two possible ways to work around this:
Use the previewHtml command if you need to create a custom view. This command allows you to hand VSCode an html document to render. Any scripts in the html will not have access to the editor's DOM, but can access their own dom and most web APIs. This approach works well if you are building a custom view or custom UI.
Call out to an external program to provide this functionality. Since the extension has access to node, to play audio for example, you could spawn a process that invokes afplay.
I want start using the framework foundation for sites but after reading the DOCS (http://foundation.zurb.com/sites/docs/installation.html) I got confused:
Why I should use a package manager to download a bunch of html, css and javascript file?
Or is there something else in the pile?
I'm working on windows and I know what are more or less html, css and javascript, but I'm new to frontend framework.
Thanks for your attention.
Download foundation first here complete-f6.zip. Then use foundation.min.css and foundation.min.js (of course include jquery.js) on your page and you're free to use whatever is in the foundation docs.
Since you're new, I would recommend using Yeti Launch. Yeti Launch allows you to create a Foundation 6 project with a Basic or Advanced template. The templates use a package manager with everything wired up for you.
With Yeti Launch you get the benefits of a build system (browser reloading, page templates, minification/concatenation, include only the components you use, autoprefixes, etc.) and you don't have to use the command line if you're not comfortable with it.
I have used several solutions like Berkelium project, CEfSharp, awesomium.net, The Web application i built constitutes of Javascipts, xml, CSS. When I used these solutions for files published on server they properly work out but when i give path like (file:///path) it stops responding.
Depending on your needs as alternatives to file:// maybe look at either:
Implementing a SchemeHandler as showcased by both the CefSharp.WinForms.Example and WPF ditto.
Maybe even an OWIN married with CEF implementation, like Harley
or see this other answer: Ajax not working in CefSharp based WebView with local files
I have a small 2D game engine written in C#, using DirectX. Is it possible to somehow run it in a browser as a plugin? Like for example Flash and others, where you go to a site with a game and it will ask you to install a certain plugin and then you can play the game in the browser, with mouse and keyboard input.
I have searched around for hours and I still don't know what I'm looking for. I have so far primarily focused on Internet Explorer, but there are plugins, addons, extensions, etc I don't know what I need really.
Yes I think it is possible.
For example, I have an HTML page which includes an element like this:
<object id="simpleControl1"
classid="http:RenderTextProject5.dll#RenderTextProject.ScrollableControl"
height="300"
width="300">
</object>
The 'classid' attribute value has the following meaning/syntax:
RenderTextProject5.dll is the filename of a compiled .NET assembly
RenderTextProject.ScrollableControl is the qualified name (namespace plus classname) of a class which subclasses System.Windows.Forms.Control
I can then see the control being rendered in the browser.
I'm using IE (IE8, but it used to work with IE6 too), and I have the .NET framework installed on my machine (but I think I needn't have the RenderTextProject5 assembly installed on the client machine).
There may be some other caveats too (e.g. I needed to run in the Intranet security zone).
See Return of the Rich Client: Code Access Security and Distribution Features in .NET Enhance Client-Side Apps.
Look for Silverlight.. It is maybe not exactly what you need but it is a browser plugin capable of running C# code ;)
There is a relatively new plugin called Unity. It is a bit more complex, as it is a dev/3D authoring environment on its own, but uses C# as its language as far as I know. However I don't know if pure 2D programming is possible (well, may be worked around using ortho 3d?).
The basic version is free to download recently, maybe worth a check.
It is possible to run C# applications in a web browser without using plugins. For example, C# applications can be compiled into JavaScript applications using JSIL.