This repository has been archived on 2026-05-25. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
visio_nrd/roles/jibri-install/templates/chrome-extension-background.js.j2
T
2021-04-28 15:43:34 +00:00

42 lines
958 B
Django/Jinja

chrome.runtime.onInstalled.addListener(function() {
chrome.storage.managed.get("forcedCookies", managedItems => {
if (!managedItems.hasOwnProperty('forcedCookies')) {
return;
}
for (const item of managedItems.forcedCookies) {
chrome.cookies.set({
url: `https://${item.domain}/`,
domain: item.domain,
name: item.name,
value: item.value
});
}
})
// temp hack because loading config from managed policies seems too slow
const forcedCookies = [
{
domain: "{{ jitsi_server_host }}",
name: "rgpd",
value: "nothing"
},
{% for host in cookies_dns|default([]) %}
{
domain: "{{ host }}",
name: "rgpd",
value: "nothing"
},
{% endfor %}
];
for (const item of forcedCookies) {
chrome.cookies.set({
url: `https://${item.domain}/`,
domain: item.domain,
name: item.name,
value: item.value
});
}
});