I am trying to access indexeddb from my application (so that I can update a live tile) in a javascript background job.
I configure the task as follows:
var builder = new Windows.ApplicationModel.Background.BackgroundTaskBuilder(); builder.name = taskName; builder.taskEntryPoint = "js\\task\\backgroundTask.js"; //Run every 8 hours if the device is on AC power var trigger = new Windows.ApplicationModel.Background.MaintenanceTrigger(480, false); builder.setTrigger(trigger); var task = builder.register();
The task is as follows:
(function () { "use strict"; var backgroundTaskInstance = Windows.UI.WebUI.WebUIBackgroundTaskInstance.current; var cancel = false; function doWork() { var key = null, settings = Windows.Storage.ApplicationData.current.localSettings;
The task works fine, but I cannot work if I can access db (or any application resources). Is this possible, perhaps the way that I missed?
source share