use super::catalogue::probe;
use super::classify::*;
use super::{Probe, Severity};
pub(super) fn misc_probes() -> Vec<Probe> {
vec![
probe("requestAnimationFrame exists",
"(() => typeof window.requestAnimationFrame === 'function')()",
Severity::Low,
classify_must_be_true),
probe("Promise exists",
"(() => typeof Promise === 'function')()",
Severity::Low,
classify_must_be_true),
probe("AbortController exists",
"(() => typeof AbortController === 'function')()",
Severity::Low,
classify_must_be_true),
probe("CSS.supports works",
"(() => typeof CSS !== 'undefined' && typeof CSS.supports === 'function')()",
Severity::Low,
classify_must_be_true),
probe("history.length sensible",
"history.length",
Severity::Low,
classify_history),
probe("document.fonts exists",
"(() => typeof document.fonts === 'object')()",
Severity::Low,
classify_must_be_true),
probe("matchMedia exists",
"(() => typeof window.matchMedia === 'function')()",
Severity::Low,
classify_must_be_true),
probe("IndexedDB exists",
"(() => typeof indexedDB === 'object')()",
Severity::Low,
classify_must_be_true),
probe("ResizeObserver exists",
"(() => typeof ResizeObserver === 'function')()",
Severity::Low,
classify_must_be_true),
probe("IntersectionObserver exists",
"(() => typeof IntersectionObserver === 'function')()",
Severity::Low,
classify_must_be_true),
probe("MutationObserver exists",
"(() => typeof MutationObserver === 'function')()",
Severity::Low,
classify_must_be_true),
probe("PerformanceObserver exists",
"(() => typeof PerformanceObserver === 'function')()",
Severity::Low,
classify_must_be_true),
probe("BroadcastChannel exists",
"(() => typeof BroadcastChannel === 'function')()",
Severity::Low,
classify_must_be_true),
probe("MessageChannel exists",
"(() => typeof MessageChannel === 'function')()",
Severity::Low,
classify_must_be_true),
probe("FileReader exists",
"(() => typeof FileReader === 'function')()",
Severity::Low,
classify_must_be_true),
probe("URL exists",
"(() => typeof URL === 'function')()",
Severity::Low,
classify_must_be_true),
probe("URLSearchParams exists",
"(() => typeof URLSearchParams === 'function')()",
Severity::Low,
classify_must_be_true),
probe("crypto.subtle exists",
"(() => typeof crypto.subtle === 'object')()",
Severity::Low,
classify_must_be_true),
probe("crypto.getRandomValues exists",
"(() => typeof crypto.getRandomValues === 'function')()",
Severity::Low,
classify_must_be_true),
probe("TextEncoder exists",
"(() => typeof TextEncoder === 'function')()",
Severity::Low,
classify_must_be_true),
probe("TextDecoder exists",
"(() => typeof TextDecoder === 'function')()",
Severity::Low,
classify_must_be_true),
probe("CompressionStream exists",
"(() => typeof CompressionStream === 'function')()",
Severity::Low,
classify_must_be_true),
probe("Headers exists",
"(() => typeof Headers === 'function')()",
Severity::Low,
classify_must_be_true),
probe("Request exists",
"(() => typeof Request === 'function')()",
Severity::Low,
classify_must_be_true),
probe("Response exists",
"(() => typeof Response === 'function')()",
Severity::Low,
classify_must_be_true),
probe("fetch exists",
"(() => typeof fetch === 'function')()",
Severity::Low,
classify_must_be_true),
probe("structuredClone exists",
"(() => typeof structuredClone === 'function')()",
Severity::Low,
classify_must_be_true),
probe("DOMParser exists",
"(() => typeof DOMParser === 'function')()",
Severity::Low,
classify_must_be_true),
probe("XMLSerializer exists",
"(() => typeof XMLSerializer === 'function')()",
Severity::Low,
classify_must_be_true),
probe("Worker exists",
"(() => typeof Worker === 'function')()",
Severity::Low,
classify_must_be_true),
probe("SharedArrayBuffer present iff cross-origin isolated",
"(() => (typeof crossOriginIsolated !== 'undefined' && !crossOriginIsolated) ? true : (typeof SharedArrayBuffer === 'function'))()",
Severity::Low,
classify_must_be_true),
probe("BigInt exists",
"(() => typeof BigInt === 'function')()",
Severity::Low,
classify_must_be_true),
probe("WeakRef exists",
"(() => typeof WeakRef === 'function')()",
Severity::Low,
classify_must_be_true),
probe("FinalizationRegistry exists",
"(() => typeof FinalizationRegistry === 'function')()",
Severity::Low,
classify_must_be_true),
probe("AbortSignal.timeout exists",
"(() => typeof AbortSignal === 'function' && typeof AbortSignal.timeout === 'function')()",
Severity::Low,
classify_must_be_true),
probe("queueMicrotask exists",
"(() => typeof queueMicrotask === 'function')()",
Severity::Low,
classify_must_be_true),
probe("Element.attachShadow exists",
"(() => typeof Element.prototype.attachShadow === 'function')()",
Severity::Low,
classify_must_be_true),
probe("Element.replaceChildren exists",
"(() => typeof Element.prototype.replaceChildren === 'function')()",
Severity::Low,
classify_must_be_true),
probe("HTMLDialogElement exists",
"(() => typeof HTMLDialogElement === 'function')()",
Severity::Low,
classify_must_be_true),
probe("CustomElementRegistry exists",
"(() => typeof customElements === 'object')()",
Severity::Low,
classify_must_be_true),
probe("globalThis exists",
"(() => typeof globalThis === 'object')()",
Severity::Low,
classify_must_be_true),
probe("isSecureContext exists",
"(() => typeof isSecureContext === 'boolean')()",
Severity::Low,
classify_must_be_true),
probe("self.crossOriginIsolated exists",
"(() => typeof self.crossOriginIsolated === 'boolean')()",
Severity::Low,
classify_must_be_true),
probe("Reporting API exists",
"(() => typeof ReportingObserver === 'function')()",
Severity::Low,
classify_must_be_true),
probe("StorageManager exists",
"(() => navigator.storage && typeof navigator.storage.estimate === 'function')()",
Severity::Low,
classify_must_be_true),
probe("Element.scroll exists",
"(() => typeof Element.prototype.scroll === 'function')()",
Severity::Low,
classify_must_be_true),
probe("KeyboardEvent.getModifierState exists",
"(() => typeof KeyboardEvent.prototype.getModifierState === 'function')()",
Severity::Low,
classify_must_be_true),
probe("PointerEvent exists",
"(() => typeof PointerEvent === 'function')()",
Severity::Low,
classify_must_be_true),
probe("Touch exists",
"(() => typeof Touch === 'function')()",
Severity::Low,
classify_must_be_true),
probe("Blob exists",
"(() => typeof Blob === 'function')()",
Severity::Low,
classify_must_be_true),
probe("File exists",
"(() => typeof File === 'function')()",
Severity::Low,
classify_must_be_true),
probe("FormData exists",
"(() => typeof FormData === 'function')()",
Severity::Low,
classify_must_be_true),
probe("XMLHttpRequest exists",
"(() => typeof XMLHttpRequest === 'function')()",
Severity::Low,
classify_must_be_true),
probe("EventSource exists",
"(() => typeof EventSource === 'function')()",
Severity::Low,
classify_must_be_true),
probe("Notification exists",
"(() => typeof Notification === 'function')()",
Severity::Low,
classify_must_be_true),
probe("Animation exists",
"(() => typeof Animation === 'function')()",
Severity::Low,
classify_must_be_true),
probe("HTMLImageElement.decode exists",
"(() => typeof HTMLImageElement.prototype.decode === 'function')()",
Severity::Low,
classify_must_be_true),
probe("Element.requestFullscreen exists",
"(() => typeof Element.prototype.requestFullscreen === 'function')()",
Severity::Low,
classify_must_be_true),
probe("Document.exitFullscreen exists",
"(() => typeof Document.prototype.exitFullscreen === 'function')()",
Severity::Low,
classify_must_be_true),
probe("Element.animate exists",
"(() => typeof Element.prototype.animate === 'function')()",
Severity::Low,
classify_must_be_true),
probe("HTMLElement.click exists",
"(() => typeof HTMLElement.prototype.click === 'function')()",
Severity::Low,
classify_must_be_true),
probe("HTMLElement.focus exists",
"(() => typeof HTMLElement.prototype.focus === 'function')()",
Severity::Low,
classify_must_be_true),
probe("HTMLElement.blur exists",
"(() => typeof HTMLElement.prototype.blur === 'function')()",
Severity::Low,
classify_must_be_true),
probe("navigator.userActivation exists",
"(() => typeof navigator.userActivation === 'object' && navigator.userActivation !== null)()",
Severity::Low,
classify_must_be_true),
probe("scheduler.postTask exists",
"(() => typeof scheduler !== 'undefined' && typeof scheduler.postTask === 'function')()",
Severity::Low,
classify_must_be_true),
]
}