Update layout BPC GitLab bio

This commit is contained in:
magnolia1234 2022-03-17 19:39:21 +01:00
parent bfe128b2fd
commit 246e7ba485
3 changed files with 30 additions and 3 deletions

View file

@ -7,6 +7,7 @@ Fix Algemeen Dagblad (regional; refresh)
Fix Folha de S. Paulo
Fix Funke Mediengruppe (opt-in to custom sites for unlisted)
Fix Lequipe.fr (refresh)
Update layout BPC GitLab bio
* v2.6.0.0 (2022-03-13)
Add Connaissance des Arts (France)

View file

@ -58,7 +58,32 @@ else if (matchDomain('nyteknik.se')) {
let hidden_images = document.querySelectorAll('img[src=""][data-proxy-image]');
for (let hidden_image of hidden_images)
hidden_image.setAttribute('src', hidden_image.getAttribute('data-proxy-image').replace('_320', '_640'));
}, 2000); // Delay (in milliseconds)
}, 2000);
}
else if (matchDomain('gitlab.com')) {
window.setTimeout(function () {
let bio = document.querySelector('div.profile-user-bio');
if (bio) {
let split = bio.innerText.split(/(https:[\w\-/.]+)|\|/g).filter(x => x && x.trim());
bio.innerText = '';
for (let part of split) {
let elem;
if (part.startsWith('https')) {
elem = document.createElement('a');
elem.innerText = part;
elem.href = part;
elem.appendChild(document.createElement('br'));
} else {
elem = document.createElement('b');
elem.appendChild(document.createTextNode(part));
if (!part.includes(':'))
elem.appendChild(document.createElement('br'));
}
bio.appendChild(elem);
}
}
}, 1000);
}
function matchDomain(domains, hostname) {

View file

@ -41,7 +41,8 @@
"matches": [
"*://*.inkl.com/*",
"*://*.nationalgeographic.com/*",
"*://*.nyteknik.se/*"
"*://*.nyteknik.se/*",
"*://*.gitlab.com/magnolia1234"
],
"run_at": "document_start",
"js": ["contentScript_once.js"]
@ -638,5 +639,5 @@
"*://*.wallkit.net/*",
"*://*.wsj.net/*"
],
"version": "2.6.0.3"
"version": "2.6.0.4"
}