PEのLocationのメンバーの最近ログイン日を見やすくする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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