mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
19 lines
458 B
JavaScript
19 lines
458 B
JavaScript
self.addEventListener('message', (message) => {
|
|
caches.open('acache').then((cache) => {
|
|
if(message.data == 'write') {
|
|
cache.add('aurl').then(() => {
|
|
message.source.postMessage({
|
|
type: 'written'
|
|
});
|
|
});
|
|
} else if (message.data == 'read') {
|
|
cache.match('aurl').then((result) => {
|
|
message.source.postMessage({
|
|
type: 'done',
|
|
cached: !!result
|
|
});
|
|
});
|
|
}
|
|
});
|
|
});
|