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

Handle domain-specific levels. More...

Functions

function getContentConfiguration (url, frameId, tabId)
 
function contentScriptLevelSetter (message, {frameId, tab})
 

Detailed Description

Handle domain-specific levels.

Author
Copyright (C) 2020 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

◆ contentScriptLevelSetter()

function contentScriptLevelSetter (   message,
  {frameId, tab} 
)

Messaging with content script.

@message The message from content script.

Returns the promise with the message returned to the content script.

◆ getContentConfiguration()

function getContentConfiguration (   url,
  frameId,
  tabId 
)

Returns the a Promise which resolves to the configuration for the current level to be used by the content script for injection

Parameters
{url}string
isPrivatebool specifying incognito mode
Bug:
iframes nested within an iframe with user-specific level do not get this level

Suppose that there is an iframe from domain C nested in an iframe from domain B that is iself nested in a visited domain A.

+---------------------------------------------------------—+

visited domain a.example
+-----------------------------------------------------—+
iframe from domain b.example
+-------------------------------------------------—+

| | | iframe from domain c.example | | | | | | | | | | | +-------------------------------------------------—+ | | | | | | | +-----------------------------------------------------—+ | +---------------------------------------------------------—+

Suppose that B has a user-defined specific level settings, and C does not have a user-defined specific level settings. The iframe of domain B gets the user-defined settings for domain B but the iframe from domain C is set with the level of domain A.

Here is the call graph for this function: