Drop-in Promise-based replacement for window.alert / window.confirm. Loaded globally on every SEO Forge admin screen via assets/js/sf-modal.js.
js
// Alert
window.sfModal.alert('Saved successfully.', { title: 'Done', variant: 'success' });
// Confirm (Promise<boolean>)
window.sfModal.confirm('Delete this redirect?', {
title: 'Delete redirect?',
okText: 'Delete',
cancelText: 'Keep',
variant: 'danger',
}).then(function (ok) {
if (ok) deleteRedirect();
});Variants: warning (default, orange), danger (red, for destructive actions), info (blue), success (green). Esc cancels, Enter confirms, clicking the overlay also cancels.
For graceful degradation if the modal script fails to load, wrap your call:
js
function sfAlert(msg, opts) {
if (window.sfModal && window.sfModal.alert) return window.sfModal.alert(msg, opts);
window.alert(msg); return Promise.resolve(true);
}—