JavaScript Restrictor
Browser extension that improves privacy and security
Loading...
Searching...
No Matches
code_builders.js File Reference

Functions that build code that modifies JS evironment provided to page scripts. More...

Functions

function enclose_wrapping (code,...args)
 
function enclose_wrapping2 (code, name, params, call_with_window)
 
function create_counter_call (wrapper, type, fpdTrackCallers)
 
function define_page_context_function (fpdTrackCallers, wrapper)
 
function generate_assign_function_code (code_spec_obj)
 
function generate_object_properties (fpdTrackCallers, code_spec_obj, fpd_only)
 
function generate_delete_properties (code_spec_obj)
 
function generate_assignement (code_spec_obj)
 

Detailed Description

Functions that build code that modifies JS evironment provided to page scripts.

Author
Copyright (C) 2019 Libor Polcak
Copyright (C) 2021 Giorgio Maone
Copyright (C) 2022 Marek Salon
Copyright (C) 2023 Martin Zmitko
License:
SPDX-License-Identifier: GPL-3.0-or-later

Function Documentation

◆ create_counter_call()

function create_counter_call (   wrapper,
  type,
  fpdTrackCallers 
)

Create code containing call of API counting function.

Here is the caller graph for this function:

◆ define_page_context_function()

function define_page_context_function (   fpdTrackCallers,
  wrapper 
)

This function create code (as string) that creates code that can be used to inject (or overwrite) a function in the page context.

Here is the call graph for this function:

◆ enclose_wrapping()

function enclose_wrapping (   code,
  args 
)

Create IIFE to wrap the code in closure

Here is the caller graph for this function:

◆ enclose_wrapping2()

function enclose_wrapping2 (   code,
  name,
  params,
  call_with_window 
)

Create wrapping that might be IIFE or a function that is immediately called and also available for future.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generate_assign_function_code()

function generate_assign_function_code (   code_spec_obj)

This function creates code that assigns an already defined function to given property.

◆ generate_assignement()

function generate_assignement (   code_spec_obj)

This function generates code that makes an assignment.

◆ generate_delete_properties()

function generate_delete_properties (   code_spec_obj)

This function removes a property.

◆ generate_object_properties()

function generate_object_properties (   fpdTrackCallers,
  code_spec_obj,
  fpd_only 
)

This function wraps object properties using WrapHelper.defineProperties().

Here is the call graph for this function: