This commit is contained in:
Mirco Wittrien 2019-11-30 11:29:12 +01:00
parent befc5c8d46
commit 491cf9e038
4 changed files with 8 additions and 6 deletions

View File

@ -3997,13 +3997,14 @@ var BDFDB = {
};
BDFDB.DiscordUtils = {};
BDFDB.DiscordUtils.openLink = function (url, inbuilt) {
BDFDB.DiscordUtils.openLink = function (url, inbuilt, minimized) {
if (!inbuilt) window.open(url, "_blank");
else {
let browserWindow = new LibraryRequires.electron.remote.BrowserWindow({
frame: true,
resizeable: true,
show: true,
darkTheme: BDFDB.DiscordUtils.getTheme() == BDFDB.disCN.themedark,
webPreferences: {
nodeIntegration: false,
nodeIntegrationInWorker: false
@ -4011,6 +4012,7 @@ var BDFDB = {
});
browserWindow.setMenu(null);
browserWindow.loadURL(url);
if (minimized) browserWindow.minimize(null);
}
};
BDFDB.DiscordUtils.getFolder = function () {

File diff suppressed because one or more lines are too long

View File

@ -138,9 +138,9 @@ class GoogleSearchReplace {
let useChromium = BDFDB.DataUtils.get(this, "settings", "useChromium");
if (!event.shiftKey) BDFDB.ContextMenuUtils.close(e.instance);
if (key == "_all") {
for (let key2 in engines) if (key2 != "_all" && engines[key2]) BDFDB.DiscordUtils.openLink(this.defaults.engines[key2].url.replace(this.textUrlReplaceString, encodeURIComponent(text)), useChromium);
for (let key2 in engines) if (key2 != "_all" && engines[key2]) BDFDB.DiscordUtils.openLink(this.defaults.engines[key2].url.replace(this.textUrlReplaceString, encodeURIComponent(text)), useChromium, event.shiftKey);
}
else BDFDB.DiscordUtils.openLink(this.defaults.engines[key].url.replace(this.textUrlReplaceString, encodeURIComponent(text)), useChromium);
else BDFDB.DiscordUtils.openLink(this.defaults.engines[key].url.replace(this.textUrlReplaceString, encodeURIComponent(text)), useChromium, event.shiftKey);
}
}));
if (!items.length) items.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {

View File

@ -166,9 +166,9 @@ class ReverseImageSearch {
let useChromium = BDFDB.DataUtils.get(this, "settings", "useChromium");
if (!event.shiftKey) BDFDB.ContextMenuUtils.close(e.instance);
if (key == "_all") {
for (let key2 in engines) if (key2 != "_all" && engines[key2]) BDFDB.DiscordUtils.openLink(this.defaults.engines[key2].url.replace(this.imgUrlReplaceString, encodeURIComponent(url)), useChromium);
for (let key2 in engines) if (key2 != "_all" && engines[key2]) BDFDB.DiscordUtils.openLink(this.defaults.engines[key2].url.replace(this.imgUrlReplaceString, encodeURIComponent(url)), useChromium, event.shiftKey);
}
else BDFDB.DiscordUtils.openLink(this.defaults.engines[key].url.replace(this.imgUrlReplaceString, encodeURIComponent(url)), useChromium);
else BDFDB.DiscordUtils.openLink(this.defaults.engines[key].url.replace(this.imgUrlReplaceString, encodeURIComponent(url)), useChromium, event.shiftKey);
}
}));
if (!items.length) items.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {