Electronic interception file: /// for reading inside zip files

I would like to read inside zip archives using Electron, as if they were folders, for example /myfolder/myarchive.zip/picture.jpg . For this I am going to intercept the file protocol

 protocol.interceptFileProtocol('file', (request, callback) => { if (insideZipArchive) { //respond with zip file contents } else { //defaultBehavior } }, (error) => { if (error) console.error('Failed to register protocol') }) 

How do I invoke default behavior? Also, executing an AJAX request inside an interceptor and executing files like this callback({data: new Buffer(xhr.responseText)}) does not work.

+5
source share

Source: https://habr.com/ru/post/1257421/


All Articles