LogoLogo
About GitLabAcceptable Ads
  • Getting Started
  • Browser Ad-Filtering Solution
    • Features
    • Getting Started
      • Quickstart
      • Integrate the Solution
      • Set up user counting
    • Guides
      • User counting
      • Configure Solution settings
      • Run separate instances of the filtering engine
      • Update the Solution
      • Understand the snippets library
      • Create a filter list
      • Testing
    • Advanced
      • Services and classes
      • Sitekey
      • ADRs
      • Frame hierarchy
  • Snippets
    • Snippets Overview
    • Behavioral Snippets
      • abort-current-inline-script
      • abort-on-property-read
      • abort-on-property-write
      • abort-on-iframe-property-read
      • abort-on-iframe-property-write
      • array-override
      • blob-override
      • cookie-remover
      • event-override
      • freeze-element
      • json-override
      • json-prune
      • override-property-read
      • prevent-listener
      • replace-fetch-response
      • replace-xhr-response
      • simulate-mouse-event
      • skip-video
      • strip-fetch-query-parameter
    • Conditional Hiding Snippets
      • hide-if-canvas-contains
      • hide-if-contains
      • hide-if-contains-image
      • hide-if-contains-similar-text
      • hide-if-contains-visible-text
      • hide-if-contains-and-matches-style
      • hide-if-has-and-matches-style
      • hide-if-labelled-by
      • hide-if-matches-computed-xpath
      • hide-if-matches-xpath
      • hide-if-matches-xpath3
      • hide-if-shadow-contains
    • Debugging Snippets
      • debug
      • log
      • profile
      • trace
    • Performance Snippets
      • race
    • Snippets Support by Platform
    • Node Highlighting
    • Accessing shadow DOM elements
  • Working with filters
  • DATA AND PRIVACY
    • Data collection at eyeo
Powered by GitBook
On this page
  • Parameters
  • Filter examples
  • Debugging

Was this helpful?

Edit on GitLab
Export as PDF
  1. Snippets
  2. Behavioral Snippets

blob-override

The blob-override snippet overrides specific parts of the Blob injected in web-pages. We override the blob constructor in a way we can intercept calls and change the blob content.

Parameters

Name
Description
Mandatory
Default value

search

The string or regex pattern to match in the blob content.

Yes

n.a.

replacement

The string to replace the matched pattern with.

No

''

needle

An optional string or regex to check in the * blob parts before applying the replacement.

No

''

Filter examples

Filter
Result

blob-override '/config = \\{[^}]*\\}/' 'config = {}' '/Sponsored/'

Will override the config content matched via regex pattern with an empty object only if the blob contains also the string Sponsored.

Debugging

The following table contains messages you'll find useful during debugging:

Message
When the message occurs
Definition

info - Wrapped Blob constructor in context

After we have wrapped the window.Blob API.

From this moment on the blob prototype is intercepted by us.

success - Replaced: search → replacement FILTER: blob-override params

After we have matched and replaced the blob content.

The filter successfully hit.

Last updated 2 days ago

Was this helpful?