Skip to content

Overview ​

inboundFiltersIntegration drops exceptions you don't care about in the browser, before they're sent — so they never reach Buglapse or count toward your quota. Typical noise: errors thrown by browser extensions, third-party widgets, or the opaque Script error. from cross-origin scripts.

It filters exceptions only, by two things:

  • the error message — ignoreErrors;
  • the URL of the script that threw, taken from the top frame of the stack — allowUrls and denyUrls.

A string pattern matches if the value contains it; a RegExp is tested against the value.

Usage ​

ts
import { use } from '@buglapse/browser'
import { inboundFiltersIntegration } from '@buglapse/browser/integrations'

use(inboundFiltersIntegration({
    ignoreErrors: ['Script error.', /ResizeObserver loop/],
    allowUrls: ['https://app.example.com'],
    denyUrls: [/^chrome-extension:\/\//, /^moz-extension:\/\//],
}))

Options ​

OptionTypeDefaultDescription
ignoreErrors(string | RegExp)[]['Script error.']Drop exceptions whose message matches any pattern
allowUrls(string | RegExp)[][]If set, keep only exceptions thrown from a matching script URL
denyUrls(string | RegExp)[][]Drop exceptions thrown from a matching script URL

Passing ignoreErrors replaces the default list — include 'Script error.' yourself if you still want it filtered. With allowUrls set, exceptions whose stack has no URL at all are dropped too.