Elim cr-checkbox
[chromium-blink-merge.git] / chrome / test / data / banners / main.js
blob8fe1af38c8680b93351b63a32015c74d12565ee5
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 var registration;
6 var interval;
8 function waitUntilActivated() {
9 if (registration && registration.active) {
10 window.location = "#sw_activated";
11 window.clearInterval(interval);
12 } else {
13 console.log("SW not yet active.");
17 function initialize() {
18 navigator.serviceWorker.register('service_worker.js')
19 .then(function(r) {
20 registration = r;
21 });
22 interval = window.setInterval(function() {waitUntilActivated()}, 50);