liuzhen932 revised this gist . Go to revision
1 file changed, 15 insertions, 26 deletions
Country_Emojis.user.js
@@ -9,30 +9,19 @@ | |||
9 | 9 | // @grant none | |
10 | 10 | // ==/UserScript== | |
11 | 11 | ||
12 | - | let style=` | |
13 | - | @font-face { | |
14 | - | font-family: NotoColorEmojiLimited; | |
15 | - | unicode-range: U+1F1E6-1F1FF; | |
16 | - | src: url(https://raw.githubusercontent.com/googlefonts/noto-emoji/main/fonts/NotoColorEmoji.ttf); | |
17 | - | font-display: swap; | |
18 | - | } | |
19 | - | .emoji { | |
20 | - | font-family: 'NotoColorEmojiLimited'; | |
21 | - | } | |
22 | - | ` | |
12 | + | let style = `@font-face{font-family:NotoColorEmojiLimited;unicode-range:U+1F1E6-1F1FF;src:url(https:font-display:swap}.emoji{font-family:'NotoColorEmojiLimited'}`; | |
23 | 13 | let s; | |
24 | - | document.head.append(s=document.createElement('style')) | |
25 | - | s.innerHTML=style | |
26 | - | for(let sheet of document.styleSheets){ | |
27 | - | try{ | |
28 | - | for(let rule of sheet.cssRules){ | |
29 | - | try { | |
30 | - | if(rule.style.fontFamily.length>0){ | |
31 | - | rule.style.fontFamily='NotoColorEmojiLimited,'+rule.style.fontFamily | |
32 | - | } | |
33 | - | } catch (error) { | |
34 | - | ||
35 | - | } | |
36 | - | } | |
37 | - | }catch(error){} | |
38 | - | } | |
14 | + | document.head.append((s = document.createElement("style"))); | |
15 | + | s.innerHTML = style; | |
16 | + | for (let sheet of document.styleSheets) { | |
17 | + | try { | |
18 | + | for (let rule of sheet.cssRules) { | |
19 | + | try { | |
20 | + | if (rule.style.fontFamily.length > 0) { | |
21 | + | rule.style.fontFamily = | |
22 | + | "NotoColorEmojiLimited," + rule.style.fontFamily; | |
23 | + | } | |
24 | + | } catch (error) {} | |
25 | + | } | |
26 | + | } catch (error) {} | |
27 | + | } |
liuzhen932 revised this gist . Go to revision
1 file changed, 38 insertions
Country_Emojis.user.js(file created)
@@ -0,0 +1,38 @@ | |||
1 | + | // ==UserScript== | |
2 | + | // @name Country Emojis | |
3 | + | // @namespace http://tampermonkey.net/ | |
4 | + | // @version 0.1 | |
5 | + | // @description try to take over the world! | |
6 | + | // @author You | |
7 | + | // @match */* | |
8 | + | // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
9 | + | // @grant none | |
10 | + | // ==/UserScript== | |
11 | + | ||
12 | + | let style=` | |
13 | + | @font-face { | |
14 | + | font-family: NotoColorEmojiLimited; | |
15 | + | unicode-range: U+1F1E6-1F1FF; | |
16 | + | src: url(https://raw.githubusercontent.com/googlefonts/noto-emoji/main/fonts/NotoColorEmoji.ttf); | |
17 | + | font-display: swap; | |
18 | + | } | |
19 | + | .emoji { | |
20 | + | font-family: 'NotoColorEmojiLimited'; | |
21 | + | } | |
22 | + | ` | |
23 | + | let s; | |
24 | + | document.head.append(s=document.createElement('style')) | |
25 | + | s.innerHTML=style | |
26 | + | for(let sheet of document.styleSheets){ | |
27 | + | try{ | |
28 | + | for(let rule of sheet.cssRules){ | |
29 | + | try { | |
30 | + | if(rule.style.fontFamily.length>0){ | |
31 | + | rule.style.fontFamily='NotoColorEmojiLimited,'+rule.style.fontFamily | |
32 | + | } | |
33 | + | } catch (error) { | |
34 | + | ||
35 | + | } | |
36 | + | } | |
37 | + | }catch(error){} | |
38 | + | } |