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.11 kB
import { CacheManager } from './cache-manager'; import { PageIntegrityConfig } from '../types'; export interface BlockedScript { url: string; reason: string; analysis?: any; } export declare function checkCachedResponse(cacheManager: CacheManager, url: string, content: string): Promise<{ blocked: boolean; reason?: string; analysis?: any; }>; export declare function analyzeAndBlockScript(scriptBlocker: ScriptBlocker, url: string, content: string): Promise<{ blocked: boolean; reason?: string; analysis?: any; }>; export declare class ScriptBlocker { private cacheManager; private blockedScripts; private config; constructor(cacheManager: CacheManager, config: PageIntegrityConfig); shouldBlockScript(url: string, content: string): Promise<{ blocked: boolean; reason?: string; analysis?: any; }>; isScriptBlocked(url: string): boolean; getBlockedScript(url: string): BlockedScript | undefined; getAllBlockedScripts(): BlockedScript[]; clearBlockedScripts(): void; getBlockedScriptsCount(): number; }