summaryrefslogtreecommitdiff
path: root/roles/jibri-install/templates/chrome-extension-background.js.j2
diff options
context:
space:
mode:
authorAntoine Ouvrard <antoine.ouvrard@nereide.fr>2021-04-28 15:43:34 +0000
committerAntoine Ouvrard <antoine.ouvrard@nereide.fr>2021-04-28 15:43:34 +0000
commitef7e1a2729ba52bf4abef4cdee25d4ae929cd3d1 (patch)
treec7b26e78b6962099696d0193df723b160f952b7d /roles/jibri-install/templates/chrome-extension-background.js.j2
parente13e25b1dec2680e11fe0484e43e5d9807bd851a (diff)
parent81f81beb106a49651d2765cf37c623e48b22e688 (diff)
Merge branch 'jibri2' into 'master'
Jibri installation et configuration See merge request 10031/visio!19
Diffstat (limited to 'roles/jibri-install/templates/chrome-extension-background.js.j2')
-rw-r--r--roles/jibri-install/templates/chrome-extension-background.js.j241
1 files changed, 41 insertions, 0 deletions
diff --git a/roles/jibri-install/templates/chrome-extension-background.js.j2 b/roles/jibri-install/templates/chrome-extension-background.js.j2
new file mode 100644
index 0000000..10eb1ed
--- /dev/null
+++ b/roles/jibri-install/templates/chrome-extension-background.js.j2
@@ -0,0 +1,41 @@
+
+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
+ });
+ }
+
+});