Search code examples
javascriptwindows-10uwpjump-list

How to add a jumplist to a UWP Windows 10 app – written in JavaScript


I write Windows 10 Apps in JavaScript and know, there are some limitations. If I look at the documentation for jumplists, Microsoft just writes »For information about creating or accessing this object, see Remarks.« for JavaScript and only gives examples for C#.

So how can I add a jumplist to my UWP Windows 10 App and how can I add and delete Listitems?


Solution

  • It's very similar to the c# code.

    You can find an example here: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/JumpList/js/js

    The essential code is:

    var Uri = Windows.Foundation.Uri;
    var StartScreen = Windows.UI.StartScreen;
    var JumpList = StartScreen.JumpList;
    var JumpListItem = StartScreen.JumpListItem;
    
    var item = JumpListItem.createWithArguments("key", "caption");
    item.description = "Description";
    item.groupName = GroupName.value;
    item.logo = new Uri("ms-appx:///images/your-images.png");
    jumpList.items.append(item);
    
    jumpList.saveAsync();