Fix sametarget

This commit is contained in:
Jeremy "EndenDragon" Zhang 2021-03-09 04:07:07 -08:00 committed by GitHub
parent 2d5a5b5131
commit 94c5e5c91a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2037,17 +2037,15 @@ var passedCookieTest = true; // If passed cross origin test
} }
$("#discordlogin_btn").click(function(e) { $("#discordlogin_btn").click(function(e) {
if (getParameterByName("sametarget") != "true") {
e.preventDefault(); e.preventDefault();
var target = "_blank"; var wid = window.open($("#discordlogin_btn").attr("href"), "_blank");
if (getParameterByName("sametarget") == "true") {
target = "";
}
var wid = window.open($("#discordlogin_btn").attr("href"), target);
postRobot.on("setSession", { window: wid }, function(event) { postRobot.on("setSession", { window: wid }, function(event) {
if (!passedCookieTest) { if (!passedCookieTest) {
session = event.data.session; session = event.data.session;
} }
}); });
}
lock_login_fields(); lock_login_fields();
wait_for_discord_login(); wait_for_discord_login();
}); });