Greasy Fork is available in English.

CracksHash Magnet Getter with Popup Blocker

Adds a floating button that gets the magnet link when pressed and blocks pop-up windows

Forfatter
JBob
Daglige installasjoner
0
Totale installasjoner
5
Vurderinger
0 0 0
Versjon
1.7
Lagd
02.06.2024
Oppdatert
02.06.2024
Lisens
MIT
Gjelder

CracksHash Magnet Getter with Popup Blocker

Description

This Tampermonkey script adds a floating button to the CracksHash website that retrieves the magnet link when pressed. It also includes a popup blocker to prevent unwanted pop-up windows. The script features a settings menu for customizing the button's text, background color, and position.

Metadata

// ==UserScript==
// @name         CracksHash Magnet Getter with Popup Blocker
// @namespace    http://tampermonkey.net/
// @version      1.7
// @description  Adds a floating button that gets the magnet link when pressed and blocks pop-up windows
// @author       ThatDudeJBob
// @match        *://crackshash.com/*
// @grant        none
// ==/UserScript==

Features

  • Floating Button: Adds a floating button labeled "Click Magnet" to the page.
  • Popup Blocker: Blocks unwanted pop-up windows.
  • Settings Menu: Customizable button text, background color, and position through a settings menu.
  • Overlay Warnings: Displays warnings when pop-ups are blocked or no magnet link is found.

Script Details

Configuration

The script uses localStorage to save and retrieve the button's text, background color, and position.

Functions

  • createElement: Helper function to create and style elements.
  • showOverlayWarning: Displays overlay warnings for a few seconds.
  • toggleSettingsMenu: Toggles the visibility of the settings menu.
  • saveSettings: Saves the button settings to localStorage and applies them.

Popup Blocking

The script overrides the window.open method to detect blocked pop-ups and display a warning if a pop-up is blocked.

Event Listeners

  • Button Click: Retrieves the magnet link and allows navigation for the action.
  • Settings Button Click: Toggles the settings menu.
  • Save Button Click: Saves settings and hides the settings menu.
  • Document Click: Closes the settings menu when clicking outside of it.
  • Window Events: Listens for beforeunload and unload events to prevent pop-ups.

Usage

  1. Install Tampermonkey: Ensure Tampermonkey is installed in your browser.
  2. Create a New Script: Open Tampermonkey and create a new script.
  3. Paste the Script: Copy and paste the provided script into the Tampermonkey editor.
  4. Save the Script: Save the script to activate it on the CracksHash website.