Kill Google Ads Interstitial (INS Overlay)

Removes broken full-screen Google Ads vignette/interstitial overlays injected via <ins id="gpt_unit_..."> elements, restoring page interaction.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Kill Google Ads Interstitial (INS Overlay)
// @namespace    https://huseyinavniuzun.com/userscripts
// @version      1.0
// @author       Hüseyin Avni Uzun
// @description  Removes broken full-screen Google Ads vignette/interstitial overlays injected via <ins id="gpt_unit_..."> elements, restoring page interaction.
// @license      MIT
// @match        *://*/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function () {
  'use strict';

  const INS_ID_PREFIX = 'gpt_unit_';

  function removeInterstitials(root) {
    const scope = root && root.querySelectorAll ? root : document;
    const targets = scope.querySelectorAll(`ins[id^="${INS_ID_PREFIX}"]`);

    for (const el of targets) {
      // Ensure it cannot capture clicks even for a moment
      el.style.setProperty('pointer-events', 'none', 'important');
      el.style.setProperty('display', 'none', 'important');
      el.remove();
    }
  }

  // Initial cleanup
  document.addEventListener('DOMContentLoaded', () => {
    removeInterstitials(document);
  });

  // Watch for async or late injections (common with vignette ads)
  const observer = new MutationObserver(mutations => {
    for (const mutation of mutations) {
      for (const node of mutation.addedNodes) {
        if (!node || node.nodeType !== 1) continue;

        if (
          node.tagName === 'INS' &&
          node.id &&
          node.id.startsWith(INS_ID_PREFIX)
        ) {
          node.remove();
        } else {
          removeInterstitials(node);
        }
      }
    }
  });

  observer.observe(document.documentElement, {
    childList: true,
    subtree: true
  });

  // Extra early pass for very fast injections
  removeInterstitials(document);
})();