Microsoft Edge Live Tile APIs are more than broken

This bug report has been submitted to Microsoft. You can track it here (for the crash) and here (for the unraised event).

To Microsoft staffs: the Issue section contains a summary of the issue and the Details section contains the environment specification as well as comprehensive reproduction steps.

This web page has been specially edited (compared to usual blog entries) so that pinning this page will make the page try reproducing the issue.

Updated on 7 April 2017 10:00 AM (CEDT): After further investigation, the content is much richer and the old title (Microsoft Edge crashes when you call certain Live Tile APIs) could not reflect the issue.

Updated on 8 April 2017: The event raising issue is by design according to the documentation of mssitepinned event. See the issue tracker link above for details.

Issue

Condition

  • You have set up your site to enable Live Tile experience.
  • You try using Live Tile JavaScript APIs to dynamically specify the polling URIs.
  • You try using mssitepinned event to detect pinning.

Symptoms

  1. Certain invocations of Live Tile APIs fail and crash Microsoft Edge.
  2. The mssitepinned event is never raised by Microsoft Edge.

Expected behaviour

  1. The invocation of APIs should succeed and not crash Microsoft Edge.
  2. The mssitepinned event should be raised appropriately.

Workaround

One can use browser configuration to specify static polling URIs, which is enough for most scenarios.

Details

Environment 1

Item Value
Hardware Surface Pro 3, 8GB, 256GB, Hong Kong
Windows Windows 10 64-bit, Version 1607, Build 14393.479
Edge Microsoft Edge 38.14393.0.0
EdgeHTML Microsoft EdgeHTML 14.14393
Language en-US

Environment 2

Item Value
Hardware Lumia 950 XL Dual SIM, People’s Republic of China
Windows Windows 10 Mobile, Version 1607, Build 10.0.14393.953
Edge Microsoft Edge 38.14393.953.0
EdgeHTML Microsoft EdgeHTML 14.14393
Language en-US

Environment 3

Item Value
Hardware Virtual Machine (available from Emulator Package)
Windows Windows Phone 8.1, OS version 8.10.12358.1191
Browser Internet Explorer 11 Mobile
Language en-US

Reproduction 1

  1. Open this page in Edge (environment 1 and 2) or IE (environment 3) and continue the reproduction on that page.
  2. Pin this page to Start by clicking … > Pin this page to Start (environment 1 and 2) or … > pin to start (environment 3).
  3. The tile is pinned to Start but does not have dynamic content.
  4. Click here immediately after the pinning has been done successfully. The link tries to call msEnableTileNotificationQueue and msStartPeriodicTileUpdateBatch to specify polling URIs for the tile.
  5. Edge crashes (environment 1 and 2) and IE does not (environment 3).
  6. In Start, the tile does not have dynamic content (environment 1 and 2) or has dynamic content (environment 3).
  7. Unpin the tile.

The code executed is equivalent to:

var arrURI = ['/tiles/1.xml', '/tiles/2.xml', '/tiles/3.xml', '/tiles/4.xml', '/tiles/5.xml'];
window.alert('About to call: msEnableTileNotificationQueue.');
window.external.msEnableTileNotificationQueue(true);
window.alert('Called: msEnableTileNotificationQueue. About to call: msStartPeriodicTileUpdateBatch.');
/* Edge crashes when executing the following line. */
window.external.msStartPeriodicTileUpdateBatch(arrURI);
/* Edge crashes before this line is reached. */
window.alert('Called: msStartPeriodicTileUpdateBatch.');

This shows that calling msStartPeriodicTileUpdateBatch on a newly pinned page will not give its desired effects and will crash Microsoft Edge.

Reproduction 2

  1. Open this page in Edge (environment 1 and 2) or IE (environment 3) and continue the reproduction on that page.
  2. Click here. The link tries to add an event listener to mssitepinned event, which will specify polling URIs for the tile.
  3. Pin this page to Start by clicking … > Pin this page to Start (environment 1 and 2) or … > pin to start (environment 3).
  4. In Start, the newly pinned tile does not have dynamic content (environment 1 and 2), or has dynamic content (environment 3).
  5. Return to Edge (environment 1 and 2) or IE (environment 3) and wait 10 seconds.
  6. Nothing happens (environment 1 and 2) or a dialog pops up (environment 3).
  7. Unpin the tile.

The code executed is equivalent to:

document.addEventListener('mssitepinned', function ()
{
    var arrURI = ['/tiles/1.xml', '/tiles/2.xml', '/tiles/3.xml', '/tiles/4.xml', '/tiles/5.xml'];
    window.external.msEnableTileNotificationQueue(true);
    window.external.msStartPeriodicTileUpdateBatch(arrURI);
    window.setTimeout(function ()
    {
        window.alert('mssitepinned was raised 10 seconds ago.');
    }, 10000);
}, false);
window.alert('Tried adding the event listener.');

This shows that mssitepinned event is never raised by Microsoft Edge.

Recommended solution

  1. Microsoft should investigate and change the implementation of Live Tile APIs so that they work properly.
  2. Microsoft should update the documentation found here because it is wrong. It says the first parameter is a string while it should be an array of strings. Also, relevant documentations of window.external object should be edited.

Below are some links to the example code by Microsoft, from which the reproduction code is derived:

Notes

I tested the page on various platforms.

Platform msStartPeriodicTileUpdateBatch mssitepinned
Edge 14 crash if invoked after pinning not raised
Edge 13 on Windows 10 crash even if not pinned not raised
Lumia 930 VM (8.10.14141.167, available from BrowserStack) good raised
Modern IE on Windows 8.1 good raised

Edge seems to be failing Live Tile APIs brilliantly.

Please enable JavaScript to view the comments powered by Disqus.