blob: 80a2188677ba5a9cc728158dbf10fd973bbc0f27 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
var eventsSeen = [];
function handler(event) { eventsSeen.push(event.type); }
['activate', 'install'].forEach(function(type) {
self.addEventListener(type, handler);
});
onmessage = function(e) {
var message = e.data;
message.port.postMessage({events: eventsSeen});
};
|