-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.js
46 lines (35 loc) · 1.1 KB
/
content.js
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
console.log("Extension activate");
let paragraphs = document.getElementsByTagName('p');
//console.log(url);
const url1 = chrome.extension.getURL('Dotsies.ttf');
console.log(url1);
var junction_font = new FontFace('JunctionRegular','url(chrome-extension://jnohippkdnjbmndieeboeiknopapiifh/Dotsies.ttf)');
for(ele of paragraphs){
ele.innerHTML = "Say What";
junction_font.load().then(function(loaded_face) {
document.fonts.add(loaded_face);
console.log('Fuck it');
ele.innerHTML="My name is slim shady";
//document.querySelector("#demo").innerHTML = "My name is slime shady";
//document.querySelector("#demo").style.fontFamily = '"Junction Regular", Tahoma';
ele.style.fontFamily = 'JunctionRegular';
}).catch(function(error) {
alert(error);
});
}
// chrome.runtime.onMessage.addListener(gotFont);
//
// function gotFont(message,sender,response){
//
// //var dotsies = FontFace(message);
// dotsies.load().then(function(loaded_face) {
// document.fonts.add(loaded_face);
// document.body.style.fontFamily = '"Dotsies", Arial';
//
//
//
// }).catch(function(error) {
// // error occurred
// });
//
// }