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

JS code for pop up. More...

Functions

function showRefreshPageOption (toggle=true)
 
function changeActiveLevel (activeEl)
 
function enableRefreshIfNeeded ()
 
function modify_level (level, levelButton, forceUpdateLevels=false)
 
function async disable_jss (orig_level)
 
function async enable_jss (level)
 
function add_level_buttons ()
 
function update_level_info ()
 
function update_tweaks ()
 
function fill_jsshield (msg)
 
function async init_jsshield ()
 
document getElementById ("global-settings").addEventListener('click'
 
function async getCurrentSite ()
 
function async ()
 
function async fpdGetSeverity ()
 Get fingerprinting severity from FPD and show it in a popup.
 
function async load_on_off_switch (prefix)
 Load switch state from storage for current site.
 
function async control_whitelist (prefix)
 Event handler for On/off switch.
 

Variables

var site
 
var pageConfiguration = {}
 
var hits
 
var current_level
 
var default_lev_button
 
var fpd_active = false
 
let popup_tweaks = Object.create(tweaks_gui)
 
popup_tweaks get_current_tweaks
 
popup_tweaks tweak_changed
 
popup_tweaks assign_custom_params
 
popup_tweaks customize_tweak_row
 
popup_tweaks cmp_groups
 
function e
 
let key = `controls-${widget.id}-checked`
 
widget checked = localStorage.getItem(key) === 'true'
 
widget onchange
 

Detailed Description

JS code for pop up.

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

Function Documentation

◆ add_level_buttons()

function add_level_buttons ( )

Load levels and add level setting buttons

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

◆ async()

function async ( )

◆ changeActiveLevel()

function changeActiveLevel (   activeEl)

Visaully highlights the active level.

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

◆ control_whitelist()

function async control_whitelist (   prefix)

Event handler for On/off switch.

Here is the call graph for this function:

◆ disable_jss()

function async disable_jss (   orig_level)

Disable JSS for this page.

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

◆ enable_jss()

function async enable_jss (   level)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ enableRefreshIfNeeded()

function enableRefreshIfNeeded ( )

Control the state of the Refresh button

Here is the caller graph for this function:

◆ fill_jsshield()

function fill_jsshield (   msg)

Fill the content of the JS Shield settings

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

◆ fpdGetSeverity()

function async fpdGetSeverity ( )

Get fingerprinting severity from FPD and show it in a popup.

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

◆ getCurrentSite()

function async getCurrentSite ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getElementById()

document getElementById (   "global-settings")

◆ init_jsshield()

function async init_jsshield ( )
Here is the call graph for this function:

◆ load_on_off_switch()

function async load_on_off_switch (   prefix)

Load switch state from storage for current site.

◆ modify_level()

function modify_level (   level,
  levelButton,
  forceUpdateLevels = false 
)

Save level settings for current page, show correct button

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

◆ showRefreshPageOption()

function showRefreshPageOption (   toggle = true)

Enable the refresh page option.

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

◆ update_level_info()

function update_level_info ( )
Here is the caller graph for this function:

◆ update_tweaks()

function update_tweaks ( )
Here is the caller graph for this function:

Variable Documentation

◆ assign_custom_params

popup_tweaks assign_custom_params
Initial value:
= function(group) {
group.groupHits = hits[group.name] || 0;
}
var hits
Definition popup.js:29

◆ checked

widget checked = localStorage.getItem(key) === 'true'

◆ cmp_groups

popup_tweaks cmp_groups
Initial value:
= function (firstObj, secondObj) {
let firstGr = firstObj.group;
let secondGr = secondObj.group;
return secondGr.groupHits - firstGr.groupHits;
}

◆ current_level

var current_level

◆ customize_tweak_row

popup_tweaks customize_tweak_row
Initial value:
= function (tweakRow, group) {
if (group.name === "wasm") {
tweakRow.querySelector(".hits").textContent = "-";
return;
}
let groupHits = group.groupHits;
if (groupHits >= 999) {
groupHits = "1000 or more";
}
else if (!fpd_active) {
let main = current_level[group.name];
let tweaks = current_level.tweaks;
if (!(tweaks && (tweaks[group.name] > 0))) {
if ((tweaks && tweaks[group.name] === 0) || (!(main > 0))) {
groupHits = String(groupHits) + " (unreliable)";
}
}
}
tweakRow.querySelector(".hits").textContent = groupHits;
}
function async main()
Definition benchmark.js:274
var fpd_active
Definition popup.js:32
var current_level
Definition popup.js:30

◆ default_lev_button

var default_lev_button

◆ e

function e
Initial value:
{
browser.runtime.openOptionsPage()

◆ fpd_active

var fpd_active = false

◆ get_current_tweaks

popup_tweaks get_current_tweaks
Initial value:
= function() {
return getTweaksForLevel(current_level.level_id, current_level.tweaks);
}
function getTweaksForLevel(level_id, tweaks_obj)
Definition levels.js:1045

◆ hits

var hits

◆ key

let key = `controls-${widget.id}-checked`

◆ onchange

widget onchange
Initial value:
= () => {
let {checked} = widget;
widget.parentElement.classList.toggle("toggled", checked);
localStorage.setItem(key, checked);
})()
widget checked
Definition popup.js:325
let key
Definition popup.js:324

◆ pageConfiguration

var pageConfiguration = {}

◆ popup_tweaks

let popup_tweaks = Object.create(tweaks_gui)

◆ site

var site

◆ tweak_changed

popup_tweaks tweak_changed
Initial value:
= function(group_id, desired_tweak) {
if (!current_level.tweaks) {
current_level.tweaks = {};
}
current_level.tweaks[group_id] = desired_tweak;
}
var domains
Definition levels.js:896
function saveDomainLevels()
Definition levels.js:979
var site
Definition popup.js:27
function enableRefreshIfNeeded()
Definition popup.js:106