if ('serviceWorker' in navigator) {
navigator.serviceWorker.register(URL.source.withFilename("sw2.js"), {
scope:URL.source.withFilename("test/")
}).then(function(registration) {
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}).catch(function(err) {
console.log('ServiceWorker registration failed: ', err);
});
}
URL.source.withFilename("test.txt").asWebResource().get().content
URL.source.withFilename("test/test.txt").asWebResource().noProxy().beAsync().get().whenDone(function(content){
alertOK("content: " + content)
})