-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcolorify.js
29 lines (22 loc) · 897 Bytes
/
colorify.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict';
globalThis.projectStorage.setup().then(() => globalThis.projectStorage.getProjects()).then(async () => {
globalThis.productionObserver.setup(() => {
if (document.readyState !== 'complete') return;
const urlParams = new URLSearchParams(window.location.search);
if (!urlParams.has('project')) {
return;
}
let noRelevantMappingDetected = true;
globalThis.projectStorage.getProjects().then((projects) => projects.forEach(project => {
if (!project) return;
if (urlParams.get('project').search(project) !== -1) {
document.body.style.border = '10px solid red';
noRelevantMappingDetected = false;
}
}));
if (noRelevantMappingDetected) {
document.body.style.border = '';
}
}).then(observer => observer.start());
document.addEventListener('unload', () => globalThis.productionObserver.stop());
});