mirror of
https://github.com/kiwix/kiwix-js.git
synced 2025-09-23 12:36:21 -04:00
Merge pull request #418 from kiwix/transfer-data-instead-of-copying-between-serviceworker-and-backend
Transfer the data from ZIM to ServiceWorker instead of copying it.
This commit is contained in:
commit
7873b751ee
@ -836,7 +836,8 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies','abstractFiles
|
|||||||
} else {
|
} else {
|
||||||
console.log("Reading binary file...");
|
console.log("Reading binary file...");
|
||||||
selectedArchive.readBinaryFile(dirEntry, function(fileDirEntry, content) {
|
selectedArchive.readBinaryFile(dirEntry, function(fileDirEntry, content) {
|
||||||
messagePort.postMessage({'action': 'giveContent', 'title' : title, 'content': content});
|
var message = {'action': 'giveContent', 'title' : title, 'content': content.buffer};
|
||||||
|
messagePort.postMessage(message, [content.buffer]);
|
||||||
console.log("content sent to ServiceWorker");
|
console.log("content sent to ServiceWorker");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user