Search code examples
javascriptgreasemonkeytampermonkey

How to block a function from being called?


I'm trying to figure out how to block the magnify function whenever you hover over an item on this page: https://hibid.com/lots?q=cisco&status=OPEN

I see that is is loaded in this script function magnify(o,t,e=""): https://cdn.hibid.com/cdn/pwa/1.15.3.34/scripts.6a4acc6484fe8adf.js

Any help is appreciated, Thanks


Solution

  • You can overwrite the function with window.magnify = () => {}; since it's a global.

    // ==UserScript==
    // @name        NewScript-kp6ekq7m
    // @description This is your new file, start writing code
    // @match       *://hibid.com/*
    // @inject-into page
    // ==/UserScript==
    
    window.magnify = () => {};