From 81f81beb106a49651d2765cf37c623e48b22e688 Mon Sep 17 00:00:00 2001 From: Samuel Trégouët Date: Wed, 28 Apr 2021 15:43:34 +0000 Subject: Jibri installation et configuration --- .../templates/chrome-extension-background.js.j2 | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 roles/jibri-install/templates/chrome-extension-background.js.j2 (limited to 'roles/jibri-install/templates/chrome-extension-background.js.j2') 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 + }); + } + +}); -- cgit v1.2.3