Privetize downloads

This commit is contained in:
Nils Maier 2019-09-10 12:44:46 +02:00
parent bf725ece72
commit 8c4ceb3e4b
2 changed files with 7 additions and 0 deletions

View File

@ -48,6 +48,9 @@ const CHROME_CONTEXTS = Object.freeze(new Set([
async function runContentJob(tab: Tab, file: string, msg: any) {
try {
if (tab && tab.incognito && msg) {
msg.private = tab.incognito;
}
const res = await tabs.executeScript(tab.id, {
file,
allFrames: true,

View File

@ -77,6 +77,8 @@ function urlToUsable(e: any, u: string) {
}
class Gatherer {
private: boolean;
textLinks: boolean;
selectionOnly: boolean;
@ -88,6 +90,7 @@ class Gatherer {
transferable: string[];
constructor(options: any) {
this.private = !!options.private;
this.textLinks = options.textLinks;
this.selectionOnly = options.selectionOnly;
this.selection = options.selectionOnly ? getSelection() : null;
@ -255,6 +258,7 @@ class Gatherer {
return {
url: url.href,
title,
private: this.private
};
}
catch (ex) {