-
Notifications
You must be signed in to change notification settings - Fork 53
/
font.ts
186 lines (161 loc) · 16.9 KB
/
font.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
export default {
type: 'custom',
data: `
// Windows also has several font substitutes that can be found here:
// Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes
const COMMON_FONTS_WINDOWS = ['Arabic Transparent', 'Arabic Transparent Bold', 'Arial', 'Arial Baltic', 'Arial Black', 'Arial CE', 'Arial CYR', 'Arial Greek', 'Arial TUR', 'Calibri', 'Cambria', 'Cambria Math', 'Candara', 'Comic Sans MS', 'Consolas', 'Constantia', 'Corbel', 'Courier', 'Courier New', 'Courier New Baltic', 'Courier New CE', 'Courier New CYR', 'Courier New Greek', 'Courier New TUR', 'Ebrima', 'Franklin Gothic Medium', 'Gabriola', 'Georgia', 'Helv', 'Helvetica', 'Impact', 'Lucida Console', 'Lucida Sans Unicode', 'Malgun Gothic', 'Microsoft Himalaya', 'Microsoft JhengHei', 'Microsoft New Tai Lue', 'Microsoft PhagsPa', 'Microsoft Sans Serif', 'Microsoft Tai Le', 'Microsoft Yi Baiti', 'Microsoft YaHei', 'Mongolian Baiti', 'MS Gothic', 'MS PGothic', 'MS Sans Serif', 'MS Serif', 'MS Shell Dlg', 'MS Shell Dlg 2', 'Palatino Linotype', 'Segoe Print', 'Segoe Script', 'Segoe UI', 'Segoe UI Light', 'Segoe UI Semibold', 'Segoe UI Symbol', 'SimSun', 'Sylfaen', 'Symbol', 'Tahoma', 'Tahoma Armenian', 'Times', 'Times New Roman', 'Times New Roman Baltic', 'Times New Roman CE', 'Times New Roman CYR', 'Times New Roman Greek', 'Times New Roman TUR', 'Tms Rmn', 'Trebuchet MS', 'Verdana', 'Webdings', 'Wingdings'];
const COMMON_FONTS_MAC = ['Al Bayan', 'Al Nile', 'Al Tarikh', 'American Typewriter', 'Andale Mono', 'Apple Braille', 'Apple Chancery', 'Apple Color Emoji', 'Apple SD Gothic Neo', 'Apple Symbols', 'AppleGothic', 'AppleMyungjo', 'Arial', 'Arial Black', 'Arial Hebrew', 'Arial Rounded MT Bold', 'Arial Narrow', 'Avenir', 'Avenir Next', 'Avenir Next Condensed', 'Ayuthaya', 'Baghdad', 'Bangla MN', 'Bangla Sangam MN', 'Baskerville', 'Beirut', 'Big Caslon', 'Bodoni 72', 'Bodoni 72 Oldstyle', 'Bodoni 72 Smallcaps', 'Bodoni Ornaments', 'Bradley Hand', 'Brush Script MT', 'Chalkboard', 'Chalkboard SE', 'Chalkduster', 'Charter', 'Cochin', 'Comic Sans MS', 'Copperplate', 'Corsiva Hebrew', 'Courier', 'Courier New', 'Damascus', 'DecoType Naskh', 'Devanagari MT', 'Devanagari Sangam MN', 'Didot', 'Diwan Kufi', 'Diwan Thuluth', 'DIN Alternate', 'DIN Condensed', 'Euphemia UCAS', 'Farah', 'Futura', 'GB18030', 'Geeza Pro', 'Geneva', 'Georgia', 'Gill Sans', 'Gujarati MT', 'Gujarati Sangam MN', 'Gurmukhi MN', 'Gurmukhi MT', 'Gurmukhi Sangam MN', 'Heiti SC', 'Heiti TC', 'Helvetica', 'Helvetica Neue', 'Herculanum', 'Hiragino Kaku Gothic StdN', 'Hiragino Maru Gothic ProN', 'Hiragino Mincho ProN', 'Hiragino Sans', 'Hoefler Text', 'ITF Devanagari', 'ITF Devanagari Marathi', 'Impact', 'InaiMathi', 'Kailasa', 'Kannada MN', 'Kannada Sangam MN', 'Kefa', 'Khmer MN', 'Khmer Sangam MN', 'Kohinoor Bangla', 'Kohinoor Devanagari', 'Kohinoor Telugu', 'Kokonor', 'Krungthep', 'KufiStandardGK', 'Lao MN', 'Lao Sangam MN', 'Lucida Grande', 'Luminari', 'Malayalam MN', 'Malayalam Sangam MN', 'Marker Felt', 'Menlo', 'Microsoft Sans Serif', 'Mishafi', 'Mishafi Gold', 'Monaco', 'Mshtakan', 'Muna', 'Myanmar MN', 'Myanmar Sangam MN', 'Nadeem', 'New Peninim MT', 'Noteworthy', 'Noto Nastaliq Urdu', 'Optima', 'Oriya MN', 'Oriya Sangam MN', 'PT Mono', 'PT Sans', 'PT Serif', 'Palatino', 'Papyrus', 'Phosphate', 'PingFang HK', 'PingFang SC', 'PingFang TC', 'Plantagenet Cherokee', 'Raanana', 'Rockwell', 'STIXGeneral', 'STIXIntegralsD', 'STIXIntegralsSm', 'STIXIntegralsUp', 'STIXIntegralsUpD', 'STIXIntegralsUpSm', 'STIXNonUnicode', 'STIXSizeFiveSym', 'STIXSizeFourSym', 'STIXSizeOneSym', 'STIXSizeThreeSym', 'STIXSizeTwoSym', 'STIXVariants', 'STSong', 'Sana', 'Sathu', 'Savoye LET', 'Shree Devanagari 714', 'SignPainter-HouseScript', 'Silom', 'Sinhala MN', 'Sinhala Sangam MN', 'Skia', 'Snell Roundhand', 'Songti SC', 'Songti TC', 'Sukhumvit Set', 'Symbol', 'Tahoma', 'Tamil MN', 'Tamil Sangam MN', 'Telugu MN', 'Telugu Sangam MN', 'Thonburi', 'Times', 'Times New Roman', 'Times Roman', 'Trattatello', 'Trebuchet MS', 'Verdana', 'Waseem', 'Webdings', 'Wingdings', 'Zapf Dingbats', 'Zapfino'];
const COMMON_FONTS_LINUX = ['Andale Mono', 'Arial', 'Arial Black', 'Bitstream Vera Sans Mono', 'Bookman Old Style', 'Calibri', 'Century Schoolbook', 'Comic Sans MS', 'Courier', 'Courier New', 'Droid Sans', 'Georgia', 'Helvetica', 'Impact', 'Liberation Mono', 'Liberation Sans', 'Noto Color Emoji', 'Noto Mono', 'Noto Sans', 'Palatino', 'Palatino Linotype', 'Times', 'Times New Roman', 'Trebuchet MS', 'Veradana', 'Webdings'];
const COMMON_FONTS_IOS = ['Academy Engraved LET', 'Al Nile', 'American Typewriter', 'Apple Color Emoji', 'Apple SD Gothic Neo', 'Arial', 'Arial Hebrew', 'Arial Rounded MT Bold', 'Avenir', 'Avenir Next', 'Avenir Next Condensed', 'Baskerville', 'Bodoni 72', 'Bodoni 72 Oldstyle', 'Bodoni 72 Smallcaps', 'Bodoni Ornaments', 'Bradley Hand', 'Chalkboard SE', 'Chalkduster', 'Charter', 'Cochin', 'Copperplate', 'Courier', 'Courier New', 'Damascus', 'Devanagari Sangam MN', 'Didot', 'DIN Alternate', 'DIN Condensed', 'Euphemia UCAS', 'Farah', 'Futura', 'Geeza Pro', 'Georgia', 'Gill Sans', 'Helvetica', 'Helvetica Neue', 'Hiragino Maru Gothic ProN', 'Hiragino Mincho ProN', 'Hiragino Sans', 'Hoefler Text', 'Kailasa', 'Kefa', 'Khmer Sangam MN', 'Kohinoor Bangla', 'Kohinoor Devanagari', 'Kohinoor Telugu', 'Lao Sangam MN', 'Malayalam Sangam MN', 'Marker Felt', 'Menlo', 'Mishafi', 'Myanmar Sangam MN', 'Noteworthy', 'Noto Nastaliq Urdu', 'Optima', 'Palatino', 'Papyrus', 'Party LET', 'PingFang HK', 'PingFang SC', 'PingFang TC', 'Rockwell', 'Savoye LET', 'Sinhala Sangam MN', 'Snell Roundhand', 'Symbol', 'Tamil Sangam MN', 'Thonburi', 'Times New Roman', 'Trebuchet MS', 'Verdana', 'Zapf Dingbats', 'Zapfino' ];
const COMMON_FONTS_ANDROID = ['Carrois Gothic SC', 'Cutive Mono', 'Cutive Mono', 'Dancing Script', 'Droid Sans', 'Droid Serif', 'Noto Sans', 'Noto Serif', 'Roboto', 'Roboto Condensed'];
const DEFAULT_FONT = ['default', 'cursive', 'fantasy', 'sans serif', 'sans-serif', 'serif', 'monospace', 'auto'];
const FONTS = {
'win1': COMMON_FONTS_WINDOWS.concat([
'Aharoni Bold', 'Andalus', 'Angsana New', 'AngsanaUPC', 'Aparajita', 'Arabic Typesetting', 'Batang', 'Browallia New', 'BrowalliaUPC', 'Cordia New', 'CordiaUPC', 'DaunPenh', 'David', 'DFKai-SB', 'DilleniaUPC', 'DokChampa', 'Dotum', 'Estrangelo Edessa', 'EucrosiaUPC', 'Euphemia', 'FangSong', 'FrankRuehl', 'FreesiaUPC', 'Gautami', 'Gisha', 'Gulim', 'Gungsuh', 'IrisUPC', 'Iskoola Pota', 'JasmineUPC', 'KaiTi', 'Kalinga', 'Kartika', 'Khmer UI', 'KodchiangUPC', 'Kokila', 'Lao UI', 'Latha', 'Leelawadee', 'Levenim MT', 'LilyUPC', 'Mangal', 'Marlett', 'Meiryo', 'Meiryo UI', 'Microsoft Ulghur', 'MingLiU', 'Miriam', 'MoolBoran', 'MS Mincho', 'MV Boli', 'Narkisim', 'Nyala', 'Plantagenet Cherokee', 'Raavi', 'Rod', 'Sakkal Majalla', 'Shonar Bangla', 'Shruti', 'SimHei', 'Simplified Arabic', 'Traditional Arabic', 'Tunga', 'Utsaah', 'Vani', 'Vijaya', 'Vrinda'
]),
'win2': COMMON_FONTS_WINDOWS.concat([
'Aharoni Bold', 'Aldhabi', 'Andalus', 'Angsana New', 'AngsanaUPC', 'Aparajita', 'Arabic Typesetting', 'Batang', 'Browallia New', 'BrowalliaUPC', 'Cordia New', 'CordiaUPC', 'DaunPenh', 'David', 'DFKai-SB', 'DilleniaUPC', 'DokChampa', 'Dotum', 'Estrangelo Edessa', 'EucrosiaUPC', 'Euphemia', 'FangSong', 'FrankRuehl', 'FreesiaUPC', 'Gadugi', 'Gautami', 'Gisha', 'Gulim', 'Gungsuh', 'IrisUPC', 'Iskoola Pota', 'JasmineUPC', 'Javanese Text', 'KaiTi', 'Kalinga', 'Kartika', 'Khmer UI', 'KodchiangUPC', 'Kokila', 'Lao UI', 'Latha', 'Leelawadee', 'Levenim MT', 'LilyUPC', 'Mangal', 'Marlett', 'Meiryo', 'Meiryo UI', 'Microsoft Ulghur', 'MingLiU', 'Miriam', 'MoolBoran', 'MS Mincho', 'MV Boli', 'Myanmar Text', 'Narkisim', 'Nirmala UI', 'Nyala', 'Plantagenet Cherokee', 'Raavi', 'Rod', 'Sakkal Majalla', 'Shonar Bangla', 'Shruti', 'SimHei', 'Simplified Arabic', 'Traditional Arabic', 'Tunga', 'Urdu Typesetting', 'Utsaah', 'Vani', 'Vijaya', 'Vrinda'
]),
'win3': COMMON_FONTS_WINDOWS.concat([
'Aharoni Bold', 'Aldhabi', 'Andalus', 'Angsana New', 'AngsanaUPC', 'Aparajita', 'Arabic Typesetting', 'Batang', 'Browallia New', 'BrowalliaUPC', 'Cordia New', 'CordiaUPC', 'DaunPenh', 'David', 'DFKai-SB', 'DilleniaUPC', 'DokChampa', 'Dotum', 'Estrangelo Edessa', 'EucrosiaUPC', 'Euphemia', 'FangSong', 'FrankRuehl', 'FreesiaUPC', 'Gadugi', 'Gautami', 'Gisha', 'Gulim', 'Gungsuh', 'IrisUPC', 'Iskoola Pota', 'JasmineUPC', 'Javanese Text', 'KaiTi', 'Kalinga', 'Kartika', 'Khmer UI', 'KodchiangUPC', 'Kokila', 'Lao UI', 'Latha', 'Leelawadee', 'Leelawadee UI', 'Levenim MT', 'LilyUPC', 'Mangal', 'Meiryo', 'Meiryo UI', 'Microsoft Ulghur', 'MingLiU', 'Miriam', 'MoolBoran', 'MS Mincho', 'MV Boli', 'Myanmar Text', 'Narkisim', 'Nirmala UI', 'Nyala', 'Plantagenet Cherokee', 'Raavi', 'Rod', 'Sakkal Majalla', 'Segoe UI Emoji', 'Shonar Bangla', 'Shruti', 'SimHei', 'Simplified Arabic', 'Sitka', 'Traditional Arabic', 'Tunga', 'Urdu Typesetting', 'Utsaah', 'Vani', 'Vrinda', 'Yu Gothic', 'Yu Mincho'
]),
'win4': COMMON_FONTS_WINDOWS.concat([
'Bahnschrift', 'Gadugi', 'HoloLens MDL2 Assets', 'Ink Free', 'Javanese Text', 'Leelawadee UI', 'Marlett', 'MingLiU-ExtB', 'Myanmar Text', 'Nirmala UI', 'Segoe MDL2 Assets', 'Segoe UI Historic', 'Segoe UI Emoji', 'Sitka', 'Yu Gothic'
]),
'mac1': COMMON_FONTS_MAC.concat([
'Hiragino Kaku Gothic ProN'
]),
'mac2': COMMON_FONTS_MAC.concat([
'Farisi'
]),
'mac3': COMMON_FONTS_MAC.concat([
'Farisi', 'Galvji', 'Kohinoor Gujarati', 'MuktaMahee', 'Noto Sans Kannada', 'Noto Sans Myanmar', 'Noto Sans Oriya'
]),
'lin1': COMMON_FONTS_LINUX.concat([
'Akaash', 'AkrutiMal1', 'AkrutiMal2', 'AkrutiTml1', 'AkrutiTml2', 'Bitstream Vera Sans', 'Bitstream Vera Serif', 'C059', 'Cantarell', 'D050000L', 'Droid Sans Mono', 'Gargi-1.2b', 'GurbaniBoliLite', 'Hack', 'Inconsolata', 'Liberation Serif', 'LIkhan', 'malayalam', 'MalOtf', 'Mukti Narrow', 'Nimbus Mono PS', 'Nimbus Roman', 'Nimbus Sans', 'Noto Mono', 'Noto Serif', 'orya', 'P052', 'padmaa', 'Pothana2000', 'Sagar', 'Sampige', 'Source Code Pro', 'Source Code Variable', 'Standard Symbols PS', 'TAMu_Kadambri', 'TAMu_Kalyani', 'TAMu_Maduram', 'TSCu_Comic', 'TSCu_Paranar', 'TSCu_Times', 'URW Bookman', 'URW Gothic', 'xos4 Terminus', 'Z003'
]),
'lin2': COMMON_FONTS_LINUX.concat([
'aakar', 'Abyssinica SIL', 'Ani', 'AnjaliOldLipi', 'AR PL Ukai', 'Chandas', 'Chilanka', 'DejaVu Sans', 'DejaVu Sans Mono', 'DejaVu Serif', 'Dyuthi', 'FreeMono', 'FreeSans', 'FreeSerif', 'Gargi', 'Garuda', 'Gubbi', 'Jamrul', 'KacstBook', 'KacstDecorative', 'KacstDigital', 'KacstFarsi', 'KacstNaskh', 'KacstOffice', 'KacstOne', 'KacstPen', 'KacstPoster', 'KacstQurn', 'KacstScreen', 'Kacstitle', 'Kalapi', 'Kalimati', 'Karumbi', 'Keraleeyam', 'Khmer OS', 'Khmer OS System', 'Kinnari', 'Laksaman', 'Liberations Serif', 'Likhan', 'LKLUG', 'Lohit Assamese', 'Lohit Bengali', 'Lohit Devanagari', 'Lohit Gujarati', 'Logit Gurmukhi', 'Lohit Kannada', 'Lohit Malayalam', 'Lohit Odia', 'Lohit Tamil', 'Lohit Tamil Classical', 'Lohit Telugu', 'Loma', 'Manjari', 'Meera', 'Mitra Mono', 'mry_KacstQurn', 'Mukti Narrow', 'Nakula', 'Navilu', 'Norasi', 'Noto Mono', 'Noto Serif', 'OpenSymbol', 'Padauk', 'padmaa', 'Pagul', 'Phetsarath OT', 'Pothana2000', 'Purisa', 'Rachana' ,'RaghuMalayalamSans', 'Rasa', 'Rekha', 'Saab', 'Sahadeva', 'Samanata', 'Samyak Devanagai', 'Samyak Gujarati', 'Samyak Malayalam', 'Samyak Tamil', 'Sarai', 'Sawasdee', 'Suruma', 'Tibetan Machine Uni', 'TlwgMono', 'TlwgTypewriter', 'Ubuntu', 'Ubuntu Mono', 'Umpush', 'Uroob', 'utkal', 'Vemana2000', 'Waree', 'Yrsa'
]),
'lin3': COMMON_FONTS_LINUX.concat([
'Abyssinica SIL', 'C059', 'Caladea', 'Cantarell', 'Carlito', 'Comfortaa', 'DejaVu Sans', 'DejaVu Sans Mono', 'DejaVu Serif', 'FreeMono', 'FreeSans', 'FreeSerif', 'Jomolhari', 'Khmer OS', 'Khmer OS System', 'Liberations Serif', 'Lohit Assamese', 'Lohit Bengali', 'Lohit Devanagari', 'Lohit Gujarati', 'Lohit Kannada', 'Lohit Odia', 'Lohit Tamil', 'Lohit Telugu', 'Meera', 'Mingzat', 'Montserrat', 'Nimbus Mono', 'Nimbus Roman', 'Nimbus Sans', 'Noto Mono', 'Nuosu SIL', 'OpenSymbol', 'P052', 'Padauk', 'PakType Naskh Basic', 'PT Sans', 'Source Code Pro', 'STIX', 'Symbola', 'URW Bookman', 'URW Gothic', 'Waree', 'Z003'
]),
'ios1': COMMON_FONTS_IOS.concat([
'Bangla Sangam MN', 'Gujarati Sangam MN', 'Gurmuhki MN', 'Heiti SC', 'Heiti TC', 'Kannada Sangam NM', 'Oriya Sangam MN', 'Telugu Sangam MN'
]),
'ios2': COMMON_FONTS_IOS.concat([
'Bangla Sangam MN', 'Buddy Build', 'Gujarati Sangam MN', 'Gurmuhki MN', 'Heiti SC', 'Heiti TC', 'Kannada Sangam NM', 'Kohinoor Gujarati', 'Noto Sans Chakma', 'Oriya Sangam MN', 'Telugu Sangam MN'
]),
'ios3': COMMON_FONTS_IOS.concat([
'Apple Symbols', 'Galvji', 'Kohinoor Gujarati', 'Mukta Mahee', 'Noto Sans Myanmar', 'Noto Sans Oriya'
]),
'and1': COMMON_FONTS_ANDROID,
'and2': COMMON_FONTS_ANDROID.concat([
'Coming Soon'
]),
'and3': COMMON_FONTS_ANDROID.concat([
'Coming Soon'
]),
'and4': COMMON_FONTS_ANDROID.concat([
'Coming Soon'
])
};
let _setAttribute = spoofContext.Element.prototype.setAttribute;
let _appendChild = spoofContext.Element.prototype.appendChild;
let selectedFonts = FONTS[CHAMELEON_SPOOF.get(spoofContext).profileOS].map(f => f.toLowerCase()).concat(DEFAULT_FONT);
const REGEX_FONT_FAMILY = /font\-family:[^;']*;?/g;
const REGEX_FONTS = /(".+?")|(.+)|('.+?'),?/g;
let getWhitelistFonts = (fontList) => {
let tmpFonts = fontList.match(REGEX_FONTS).map(f => f.replace(/,+$/, ""));
let fonts = [];
for (let i = 0; i < tmpFonts.length; i++) {
if (selectedFonts.includes(tmpFonts[i].trim().replace(/^("|')|("|')$/, "").toLowerCase())) {
fonts.push(tmpFonts[i]);
}
}
return (fonts.length ? fonts : DEFAULT_FONT).join(',');
}
let modifyCSS = (css) => {
let matches = css.match(REGEX_FONT_FAMILY);
if (matches) {
matches.forEach(m => {
let fonts = m.replace(/;$/, '').split(':')[1];
css = css.replace(m, 'font-family: ' + getWhitelistFonts(fonts) + ';');
});
}
return css;
}
let modifyFontFamily = (node) => {
node.style.fontFamily = getWhitelistFonts(node.style.fontFamily);
}
let modifyNodeFont = (node) => {
if (node) {
if (node.style && node.style.fontFamily != '') {
modifyFontFamily(node);
}
node.childNodes.forEach(modifyNodeFont);
}
return node;
}
// modify CSS2Properties fontFamily
// In Firefox, the fontFamily property is located here instead of CSSStyleDeclaration
Object.defineProperty(spoofContext.CSS2Properties.prototype, "fontFamily", {
set: function fontFamily(f) {
this["font-family"] = getWhitelistFonts(f);
}
});
// modify CSSStyleDeclaration cssText
{
let obj = Object.getOwnPropertyDescriptor(spoofContext.CSSStyleDeclaration.prototype, 'cssText');
Object.defineProperty(spoofContext.CSSStyleDeclaration.prototype, 'cssText', {
set(css) {
obj.set.call(this, modifyCSS(css));
}
})
}
// replace stylesheet
function CHAMELEON_SPOOF_f() {
try {
for (let i = 0; i < spoofContext.document.styleSheets.length; i++) {
for (let j = 0; j < spoofContext.document.styleSheets[i].cssRules.length; j++) {
// check if loaded font
if (spoofContext.document.styleSheets[i].cssRules[j].type === CSSRule.FONT_FACE_RULE) {
let loaded = spoofContext.document.styleSheets[i].cssRules[j].style.getPropertyValue("font-family").toLowerCase();
if (!selectedFonts.includes(loaded)) {
selectedFonts.push(loaded);
}
}
let font = spoofContext.document.styleSheets[i].cssRules[j].style.fontFamily;
if (font) spoofContext.document.styleSheets[i].cssRules[j].style.fontFamily = getWhitelistFonts(font);
}
}
} catch (e) {
// Firefox throws a SecurityError if a stylesheet is being loaded from another domain with CORS
// Attempt again if CSS has not finished loading
if (e.name === "InvalidAccessError") {
setTimeout(CHAMELEON_SPOOF_f, 10);
}
}
}
spoofContext.document.fonts.onloadingdone = function(evt) {
for (let f of evt.fontfaces) {
let fontFamily = f.family.replace(/\"/g, '').toLowerCase();
if (!selectedFonts.includes(fontFamily)) {
selectedFonts.push(fontFamily);
}
}
CHAMELEON_SPOOF_f();
};
Object.defineProperty(spoofContext.Element.prototype, 'setAttribute', {
value: function setAttribute(name, value) {
if (name == 'style') {
value = modifyCSS(value);
}
_setAttribute.call(this, name, value);
}
});
modifiedAPIs.push([
spoofContext.Element.prototype.setAttribute, "setAttribute"
]);
`,
};