remove check for valid url before redirect, it break some bypasses

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

View file

@ -4,7 +4,7 @@
// @run-at document-start // @run-at document-start
// @author Amm0ni4 // @author Amm0ni4
// @noframes // @noframes
// @version 94.0.20 // @version 94.0.21
// @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.20 // @version 94.0.21
// @grant GM_setValue // @grant GM_setValue
// @grant GM_getValue // @grant GM_getValue
// @grant GM_addStyle // @grant GM_addStyle
@ -1502,12 +1502,12 @@
const url = window.location.href const url = window.location.href
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); window.location.assign(finalUrl);
} else { //} else {
showAlert("Invalid URL: " + finalUrl, 'error', 3000, '', 'secondary'); // showAlert("Invalid URL: " + finalUrl, 'error', 3000, '', 'secondary');
} //}
} }
const fastRedirect = (url) => window.location.assign(url); const fastRedirect = (url) => window.location.assign(url);
const showClickMsg = () => typeof showAlert === 'function' ? showAlert("Button clicked...", 'success', 1000, '', 'secondary') : console.log("Button clicked..."); const showClickMsg = () => typeof showAlert === 'function' ? showAlert("Button clicked...", 'success', 1000, '', 'secondary') : console.log("Button clicked...");

View file

@ -249,12 +249,12 @@
const url = window.location.href const url = window.location.href
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); window.location.assign(finalUrl);
} else { //} else {
showAlert("Invalid URL: " + finalUrl, 'error', 3000, '', 'secondary'); // showAlert("Invalid URL: " + finalUrl, 'error', 3000, '', 'secondary');
} //}
} }
const fastRedirect = (url) => window.location.assign(url); const fastRedirect = (url) => window.location.assign(url);
const showClickMsg = () => typeof showAlert === 'function' ? showAlert("Button clicked...", 'success', 1000, '', 'secondary') : console.log("Button clicked..."); const showClickMsg = () => typeof showAlert === 'function' ? showAlert("Button clicked...", 'success', 1000, '', 'secondary') : console.log("Button clicked...");

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.20 // @version 94.0.21
// @match *://*/* // @match *://*/*
// @grant GM_setValue // @grant GM_setValue
// @grant GM_getValue // @grant GM_getValue