vungle - Prevent Auto Downloads

Block automatic file downloads

// ==UserScript==
// @name         vungle - Prevent Auto Downloads
// @namespace    https://github.com/Procyon-b
// @version      1.0.1
// @description  Block automatic file downloads
// @author       Achernar
// @match        https://publisher.vungle.com/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function() {
"use strict'";

document.addEventListener('click', function(e) {
  var el = e.target.closest('a[download]');
  if (el) {
    //console.log('Blocked download link:', el.href);
    let st=(new Error()).stack;
    //console.info({st}, st);
    if (st.search(/MessagePort\._|bundle\.main/) == -1) return;
    e.preventDefault();
    e.stopPropagation();
    }
  }, true);

})();