摘要:
In some rare cases, you need to ask user to refresh the browsser to update the version. Maybe because some secrity issues. As we have learnt so far. A 阅读全文
摘要:
So once you modify the code, service worker will auto create a new one and it won't take control over until the previous service work total die(close 阅读全文
摘要:
If you want your application works offline or lie-wifi. You need to use cache. API: Create Caches: Create single cache: Get the cache: When to start c 阅读全文
摘要:
For example, if the url is not match to any API endpoint, we want to return 404 error message. So first thing, we want to send the request to the serv 阅读全文
摘要:
Learn how to user console.count in order to log out how many times a given thing has happened. for(var i = 0; i < 10; i++){ var num = Math.random() * 阅读全文
摘要:
Learn about console.assert, which is syntactic sugar for logging an error the console when a given condition is not met. It's useful, but may not do w 阅读全文
摘要:
Organize your log output by grouping your logs into collapsable hierarchies using console.group(). for(var i = 0; i < 100; i++){ var num = Math.random 阅读全文
摘要:
Previously we saw how to Hijacking all the reqest, but this is not useful. So now we want to see how to Hijacking one kind of request. For example we 阅读全文
摘要:
With endsWith && startsWith, you can easily find out whether the string ends or starts with some other string: example: So you don't need to write reg 阅读全文
摘要:
We want to do offline first, the first thing we need to do is we should able to catch the browser request and return our cache data from serice worker 阅读全文