async function bypassRequests (execution_method) {
  const rawOpen = XMLHttpRequest.prototype.open
  XMLHttpRequest.prototype.open = function () {
    this.addEventListener('load', execution_method)
    rawOpen.apply(this, arguments)
  }

  const rawFetch = window.fetch
  window.fetch = async (requestInfo, init) => {
    const result = await rawFetch(requestInfo, init)
    execution_method(result)
    return Promise.resolve(result)
  }
}
Will add an event listener to the page to check for requests and then call a function. This is useful if you need to bypass a link shortener that uses requests to get the final URLs.
@param {Function} f - The function to call
@returns {Promise} - A promise that resolves when the function is called