machawk1 / warcreate

Chrome extension to "Create WARC files from any webpage"
https://warcreate.com
MIT License
206 stars 13 forks source link

All tabs headers inserted in resulting warc file #54

Open diegito opened 10 years ago

diegito commented 10 years ago

When getting the warc file from one tab, when I edit it I see that also other headers from other opened tabs I have are inserted. Perhaps the filtering inside code.js for chrome.webRequest.onBeforeSendHeaders and chrome.webRequest.onHeadersReceived does not work?

diegito commented 10 years ago

Cause of this is the asynchronous behaviour of getSelected and onBeforeSendHeaders.addListener(), see http://stackoverflow.com/questions/24538439/chrome-extensions-webrequest-filtering-by-tabid-not-working.

machawk1 commented 10 years ago

I can imagine an instance where a user will load sites in two different tabs and would want to create WARCs from each tab (e.g., archiving all sections of a website). The issue here is all tabs' queried are being lumped together. The solution might be to have some associate array -like (because JS only has Objs) structure to attribute data from each tab to its respective tab and, on pressing the Generate WARC button, reference the array as a basis for what to write.

machawk1 commented 10 years ago

Related #7