i want to build a chrome extension, download some file one by one, so i need pair the download file and the tabid that fire the download.
chrome.webRequest.onBeforeRequest.addListener(function (e) {
log("onBeforeRequest:", JSON.stringify(e));
}, { urls: ["<all_urls>"] }, []);
use this code i can get the url, but can't get the tabid. the tabid is -1 allways, then, how can i get the correct tabid or how can i pair the download and the tabid?
fyi, i can't get <a>
or href, i just mock click() event one by one.