remove message before redirect because it breaks the bypass in some cases

This commit is contained in:
Amm0ni4 2025-02-28 01:28:31 +01:00
parent a2ef8cf6bb
commit 88280f1163
4 changed files with 7 additions and 5 deletions

View file

@ -4,7 +4,7 @@
// @run-at document-start // @run-at document-start
// @author Amm0ni4 // @author Amm0ni4
// @noframes // @noframes
// @version 94.0.19 // @version 94.0.20
// @grant GM_setValue // @grant GM_setValue
// @grant GM_getValue // @grant GM_getValue
// @grant GM_addStyle // @grant GM_addStyle

View file

@ -4,7 +4,7 @@
// @run-at document-start // @run-at document-start
// @author Amm0ni4 // @author Amm0ni4
// @noframes // @noframes
// @version 94.0.19 // @version 94.0.20
// @grant GM_setValue // @grant GM_setValue
// @grant GM_getValue // @grant GM_getValue
// @grant GM_addStyle // @grant GM_addStyle
@ -1503,7 +1503,8 @@
const isValidUrl = url => /^(?:https?|ftp):\/\/(?:\w+\.){1,3}\w+(?:\/\S*)?$/.test(url); const isValidUrl = url => /^(?:https?|ftp):\/\/(?:\w+\.){1,3}\w+(?:\/\S*)?$/.test(url);
function redirect(finalUrl) { function redirect(finalUrl) {
if (isValidUrl(finalUrl)) { if (isValidUrl(finalUrl)) {
typeof redirectWithMessage === 'function' ? redirectWithMessage(finalUrl) : window.location.assign(finalUrl); //typeof redirectWithMessage === 'function' ? redirectWithMessage(finalUrl) : window.location.assign(finalUrl);
window.location.assign(finalUrl);
} else { } else {
showAlert("Invalid URL: " + finalUrl, 'error', 3000, '', 'secondary'); showAlert("Invalid URL: " + finalUrl, 'error', 3000, '', 'secondary');
} }

View file

@ -250,7 +250,8 @@
const isValidUrl = url => /^(?:https?|ftp):\/\/(?:\w+\.){1,3}\w+(?:\/\S*)?$/.test(url); const isValidUrl = url => /^(?:https?|ftp):\/\/(?:\w+\.){1,3}\w+(?:\/\S*)?$/.test(url);
function redirect(finalUrl) { function redirect(finalUrl) {
if (isValidUrl(finalUrl)) { if (isValidUrl(finalUrl)) {
typeof redirectWithMessage === 'function' ? redirectWithMessage(finalUrl) : window.location.assign(finalUrl); //typeof redirectWithMessage === 'function' ? redirectWithMessage(finalUrl) : window.location.assign(finalUrl);
window.location.assign(finalUrl);
} else { } else {
showAlert("Invalid URL: " + finalUrl, 'error', 3000, '', 'secondary'); showAlert("Invalid URL: " + finalUrl, 'error', 3000, '', 'secondary');
} }

View file

@ -37,7 +37,7 @@
// @namespace Violentmonkey Scripts // @namespace Violentmonkey Scripts
// @run-at document-start // @run-at document-start
// @author Bloggerpemula // @author Bloggerpemula
// @version 94.0.19 // @version 94.0.20
// @match *://*/* // @match *://*/*
// @grant GM_setValue // @grant GM_setValue
// @grant GM_getValue // @grant GM_getValue