Skip to content

Commit

Permalink
added diri de-blur
Browse files Browse the repository at this point in the history
  • Loading branch information
on committed Mar 26, 2025
1 parent 508428a commit 55c4d73
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions diri.user.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// ==UserScript==
// @name Diri.ai Patch
// @namespace https://git.ntnu.no/M365-Drift/MonkeyMagic
// @version 0.1
// @description Sets --blur-xs to 0px instead of 4px for diri.ai
// @author Øyvind Nilsen
// @match https://diri.ai/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=diri.ai
// @grant none
// @run-at document-start
// @updateURL https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/diri.user.js
// @downloadURL https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/diri.user.js
// ==/UserScript==

(function() {
'use strict';

// Method 1: Create a style element and add it to the head
const styleElement = document.createElement('style');
styleElement.textContent = `
:host, :root {
--blur-xs: 0px !important;
}
`;

// Add the style element as soon as the document head is available
const addStyle = () => {
if (document.head) {
document.head.appendChild(styleElement);
} else {
// If document.head isn't available yet, try again shortly
setTimeout(addStyle, 10);
}
};

addStyle();

// Method 2: Observe and update any dynamically added stylesheets
// This handles cases where styles are added dynamically after page load
document.addEventListener('DOMContentLoaded', () => {
// Update the CSS variable in the computed styles
document.documentElement.style.setProperty('--blur-xs', '0px');

// Set up a MutationObserver to watch for style changes
const observer = new MutationObserver((mutations) => {
document.documentElement.style.setProperty('--blur-xs', '0px');
});

// Start observing the document with the configured parameters
observer.observe(document.documentElement, {
childList: true,
subtree: true,
attributes: true,
attributeFilter: ['style', 'class']
});
});
})();

0 comments on commit 55c4d73

Please sign in to comment.