Skip to content

Instantly share code, notes, and snippets.

@neetsdkasu
Last active Jul 13, 2021
Embed
What would you like to do?
PEのLocationのメンバーの最近ログイン日を見やすくする
{
"manifest_version": 2,
"name": "clearly last active on Project Euler Location statistics members",
"version": "1.0",
"author": "Leonardone",
"description": "clearly last active on Project Euler Location statistics members",
"icons" : {
"48": "icon.png"
},
"content_scripts": [
{
"matches": ["*://projecteuler.net/location=*"],
"js": ["script.js"],
"run_at": "document_end"
}
]
}
// script.js
// Browser WebExtention
// clearly last active on Project Euler Location statistics members
// author: Leonardone
document
.querySelectorAll('div.tooltip > span.tooltiptext')
.forEach(e => {
e.className='';
let s = e.textContent.split('active')[1];
e.textContent = s;
if (s.indexOf('day') >= 0) {
e.style='color: blue; font-size: small; font-weight: bold;';
} else if (s.indexOf('week') >= 0) {
let n = parseInt(s.trim().split(' ')[0]);
if (n < 5) {
e.style='color: blue; font-size: small;';
} else {
e.style='color: purple; font-size: small;';
}
} else {
e.style='color: gray; font-size: small;';
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment