UNPKG

page-integrity-js

Version:

A library for monitoring and controlling DOM mutations and script execution, essential for PCI DSS compliance and security audits

34 lines (33 loc) 1.2 kB
import { ScriptBlocker } from './script-blocker'; /** * Intercepts a script element and checks if it should be blocked. * @param script The script element to check * @param scriptBlocker The script blocker instance */ export declare function interceptScriptElement(script: HTMLScriptElement, scriptBlocker: ScriptBlocker): Promise<void>; /** * Intercepts global methods that can execute scripts. * @param scriptBlocker The script blocker instance */ export declare function interceptGlobalMethods(scriptBlocker: ScriptBlocker): void; /** * Manages script interception and monitoring. */ export declare class ScriptInterceptor { private scriptBlocker; private originalCreateElement; private originalSetAttribute; private originalAppendChild; private originalInsertBefore; private originalReplaceChild; private _isRunning; constructor(scriptBlocker: ScriptBlocker); static createInstance(scriptBlocker: ScriptBlocker): ScriptInterceptor; start(): void; stop(): void; private interceptCreateElement; private interceptSetAttribute; private interceptAppendChild; private interceptInsertBefore; private interceptReplaceChild; }