Bypass Confirmations

Bypass all confirmation dialogs

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
Sue Smith MD
今日安裝
1
安裝總數
3
評價
0 0 0
版本
1.0.0
建立日期
2025-12-25
更新日期
2025-12-25
尺寸
4.3 KB
授權條款
AGPL-3.0
腳本執行於
所有網站

Remove All Confirmations

Bypass all confirmation dialogs on web pages.

What It Does

Removes these annoying confirmations:

  • window.confirm() dialogs
  • "Leave site?" warnings (beforeunload)
  • Rails-style confirmation attributes (data-confirm, etc.)
  • Inline onclick="confirm(...)" handlers
  • Form submit confirmations

How It Works

  1. Overrides browser APIs - Makes window.confirm() always return true
  2. Blocks beforeunload events - Prevents "leave page" warnings
  3. Cleans DOM - Removes confirmation attributes from elements
  4. Monitors changes - Watches for new confirmations being added

Installation

  1. Install a userscript manager (Violentmonkey, Tampermonkey, etc.)
  2. Click the script file to install
  3. Done - runs automatically on all sites

Performance

  • Skips iframes (each gets its own instance)
  • Debounced DOM monitoring (50ms delay)

Technical Details

API Overrides:

  • window.confirm → always true
  • BeforeUnloadEvent.returnValue → read-only, always empty
  • window.onbeforeunload → read-only, always null
  • EventTarget.addEventListener → ignores beforeunload listeners

DOM Cleanup:

  • Removes data-confirm, data-action-confirm, etc.
  • Removes inline handlers containing confirm()
  • Removes form handlers containing confirm()

Monitoring:

  • MutationObserver watches for new elements and attribute changes
  • Automatically cleans confirmations as they're added