wwi - Dave's Blog

Search
My timeline on Mastodon

Multiple Windows in Win10 JavaScript UWP apps

2018 Mar 10, 1:47

Win10 Changes

In Win8.1 JavaScript UWP apps we supported multiple windows using MSApp DOM APIs. In Win10 we use window.open and window and a new MSApp API getViewId and the previous MSApp APIs are gone:

Win10 Win8.1
Create new window window.open MSApp.createNewView
New window object window MSAppView
viewId MSApp.getViewId(window) MSAppView.viewId

WinRT viewId

We use window.open and window for creating new windows, but then to interact with WinRT APIs we add the MSApp.getViewId API. It takes a window object as a parameter and returns a viewId number that can be used with the various Windows.UI.ViewManagement.ApplicationViewSwitcher APIs.

Delaying Visibility

Views in WinRT normally start hidden and the end developer uses something like TryShowAsStandaloneAsync to display the view once it is fully prepared. In the web world, window.open shows a window immediately and the end user can watch as content is loaded and rendered. To have your new windows act like views in WinRT and not display immediately we have added a window.open option. For example
let newWindow = window.open("https://example.com", null, "msHideView=yes");

Primary Window Differences

The primary window that is initially opened by the OS acts differently than the secondary windows that it opens:

Primary Secondary
window.open Allowed Disallowed
window.close Close app Close window
Navigation restrictions ACUR only No restrictions

The restriction on secondary windows such that they cannot open secondary windows could change in the future depending on feedback.

Same Origin Communication Restrictions

Lastly, there is a very difficult technical issue preventing us from properly supporting synchronous, same-origin, cross-window, script calls. That is, when you open a window that's same origin, script in one window is allowed to directly call functions in the other window and some of these calls will fail. postMessage calls work just fine and is the recommended way to do things if that's possible for you. Otherwise we continue to work on improving this.

PermalinkComments

Retweet of simevidas

2015 Jul 26, 8:27
The size of web fonts (per page) quadrupled over the last 2 years: http://httparchive.org/trends.php?s=All&minlabel=Jul+15+2013&maxlabel=Jul+15+2015#bytesFont&reqFont … pic.twitter.com/zl8HgpZDg0
PermalinkComments

WWIII Propaganda Posters - a set on Flickr

2009 Jul 7, 6:16I'm a sucker for the WWII propaganda posters.PermalinkCommentshumor twitter google propaganda poster flickr wwii via:swannman

WWII Government Bonds Poster

2008 Jun 24, 9:57

sequelguy posted a photo:

WWII Government Bonds Poster

A WWII poster proclaims: "Save to beat the devil! Buy vicotry bonds" depicting a stylized Hitler as the devil looking concerned.

PermalinkCommentscanada art poster hitler wwii victoria devil royalbritishcolumbiamuseum

Watermind Home of the American Classics Line featuring Rosie the Riveter

2008 May 28, 3:27A WWI poster with a fallen plane and the text "consider the possible consequences if you are careless in your work". I feel like this should go up in Eric's office.PermalinkCommentsposter purchase wwi propaganda
Older Entries Creative Commons License Some rights reserved.