Greasy Fork is available in English.
Block unauthorized redirects and prevent history manipulation
The "Stop Nefarious Redirects" Tampermonkey script is designed to block unauthorized redirects and prevent history manipulation on websites. This script helps users maintain control over their browsing experience by ensuring that only trusted URLs can navigate or open new windows, thus protecting against malicious redirections.
window.location.assign and window.open methods for later use.window.location.assign: Overrides the window.location.assign method to check the destination URL against the whitelist and blacklist before allowing the navigation.window.open: Overrides the window.open method to check if the popup's URL is in the whitelist. If not, the popup is blocked.window.locationwindow.location to intercept property assignments and handle navigation attempts.window.location using Object.defineProperty to ensure it is always used.popstate events to handle back and forward button navigation. If the destination URL is not allowed, it blocks the navigation and redirects to the last known good URL.history.pushState and history.replaceState to prevent history manipulation to blocked URLs.The "Stop Nefarious Redirects" script is a powerful tool to enhance your browsing security by blocking malicious redirects and preventing unauthorized history manipulation. Install this script to take control of your web navigation and protect yourself from nefarious online activities.