Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var nodes = document.evaluate('//body//text()', document, null, 6, null),
- validRange, node, text, j, i, charText;
- // -------------------------- EDIT FONT HERE --------------------------
- GM_addStyle('' +
- '.non-uni-text { ' +
- 'font-family: "Dejavu Sans" !important; ' +
- '}' +
- '');
- // ------------------------ / EDIT FONT HERE --------------------------
- for (j = 0; node = nodes.snapshotItem(j); j += 1) {
- text = node.data;
- validRange = true;
- for (i = 0; i < text.length; i += 1) {
- // 55203 is the last unicode character Dejavu Sans supports
- if (text.charAt(i).charCodeAt(0) > 55203) {
- validRange = false;
- }
- }
- if (validRange) {
- node.parentNode.classList.add('non-uni-text');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement