Added download feature for Unix, Linux, and MacOS systems using native messaging.

This commit is contained in:
2019-01-07 01:48:10 -06:00
parent e5d019fdbf
commit a638cefe21
7 changed files with 80 additions and 9 deletions

View File

@@ -16,4 +16,11 @@ const handleUpdated = (tabId, changeInfo, tabInfo) => {
}
}
const notify = (data) => {
let port = browser.runtime.connectNative("web_video_dl");
console.log("Downloding: " + data.url);
port.postMessage(data.url);
}
browser.runtime.onMessage.addListener(notify);
browser.tabs.onUpdated.addListener(handleUpdated);