Problem
Due to the way that Chrome handles partial downloads and the downloads API, it does not seem possible to get the filepath of a specific downloaded file.
Background
I am writing an extension that downloads files. These are packet captures, which are used to solve network problems. Packet captures consist of a list of self-contained packets, so 10% of a downloaded file could be as useful as 20% if the data you're looking for is in the first 10%.
I use downloads API to specify the filename I want, but the file I see is ~ "Unconfirmed 123456.crdownload".
I am using the native messaging API as well, but it receives the filename, which is different from the partial download's name.
Potential Solutions
* If the crdownload number is deterministic, I could use that with the path of the download folder
* At worst, I can use the native messaging API to monitor the download folder for new files and callback the content script if there is one (with first ~8 bytes matching pcap format)
Question
What is the best way to determine the filepath of a partial download that your extension initiated?