From 5bb54803dc1e268f77ec4d4b6f6faa1a78f6a03e Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Thu, 12 Dec 2024 14:42:17 +0100 Subject: [PATCH] Make background blur optional. --- static/galene.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/static/galene.js b/static/galene.js index 2eacbb6..4905e9a 100644 --- a/static/galene.js +++ b/static/galene.js @@ -1226,6 +1226,16 @@ let filters = { }, 'background-blur': { description: 'Background blur', + predicate: async function() { + let r = await fetch('/third-party/tasks-vision/vision_bundle.mjs', { + method: 'HEAD', + }); + if(!r.ok && r.status !== 404) + console.warn( + `Fetch vision_bundle.mjs: ${r.status} ${r.statusText}`, + ); + return r.ok; + }, init: async function(ctx) { if(!(this instanceof Filter)) throw new Error('Bad type for this');