-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.js
50 lines (43 loc) · 1.21 KB
/
popup.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
47
48
49
50
// let userinput = document.getElementById('#userinput');
// userinput.input(changeText);
// function changeText() {
// let params = {
// active: true,
// currentWindow: true
// };
// chrome.tabs.query(params, gotTabs);
// function gotTabs(tab) {
// let message = userinput.value();
// console.log(message);
// let msg = {
// txt: "hello"
// };
// chrome.tabs.sendMessage(tab[0].id, msg);
// }
// }
// let zoom = document.getElementById('zoomText');
// zoom.onclick = zoomThatText;
// function zoomThatText() {
// chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
// let paragraphs = document.getElementsByTagName('p');
// for (elt of paragraphs) {
// elt.style['font-size'] = '30px';
// elt.style['line-height'] = '1.5';
// }
// });
// }
//chrome.runtime.onMessage.addListener(gotMessage);
function gotMessage(message, sender, sendResponse) {
console.log(message);
if (message.txt === "on") {
let paragraphs = document.getElementsByTagName('p');
let links = document.getElementsByTagName('a');
for (elt of paragraphs) {
elt.style['font-size'] = '30px';
elt.style['line-height'] = '1.5';
}
for (elt of links) {
elt.style['font-weight'] = 'bold';
}
}
}