Privetize downloads
This commit is contained in:
parent
bf725ece72
commit
8c4ceb3e4b
@ -48,6 +48,9 @@ const CHROME_CONTEXTS = Object.freeze(new Set([
|
|||||||
|
|
||||||
async function runContentJob(tab: Tab, file: string, msg: any) {
|
async function runContentJob(tab: Tab, file: string, msg: any) {
|
||||||
try {
|
try {
|
||||||
|
if (tab && tab.incognito && msg) {
|
||||||
|
msg.private = tab.incognito;
|
||||||
|
}
|
||||||
const res = await tabs.executeScript(tab.id, {
|
const res = await tabs.executeScript(tab.id, {
|
||||||
file,
|
file,
|
||||||
allFrames: true,
|
allFrames: true,
|
||||||
|
@ -77,6 +77,8 @@ function urlToUsable(e: any, u: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Gatherer {
|
class Gatherer {
|
||||||
|
private: boolean;
|
||||||
|
|
||||||
textLinks: boolean;
|
textLinks: boolean;
|
||||||
|
|
||||||
selectionOnly: boolean;
|
selectionOnly: boolean;
|
||||||
@ -88,6 +90,7 @@ class Gatherer {
|
|||||||
transferable: string[];
|
transferable: string[];
|
||||||
|
|
||||||
constructor(options: any) {
|
constructor(options: any) {
|
||||||
|
this.private = !!options.private;
|
||||||
this.textLinks = options.textLinks;
|
this.textLinks = options.textLinks;
|
||||||
this.selectionOnly = options.selectionOnly;
|
this.selectionOnly = options.selectionOnly;
|
||||||
this.selection = options.selectionOnly ? getSelection() : null;
|
this.selection = options.selectionOnly ? getSelection() : null;
|
||||||
@ -255,6 +258,7 @@ class Gatherer {
|
|||||||
return {
|
return {
|
||||||
url: url.href,
|
url: url.href,
|
||||||
title,
|
title,
|
||||||
|
private: this.private
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
catch (ex) {
|
catch (ex) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user