forked from wseagar/eight-dollars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
content.js
32 lines (29 loc) · 853 Bytes
/
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
const defaultConfig = {
memeMode: false,
textEnabled: true,
textOptions: {
verifiedLabel: "Verified",
twitterBlueLabel: "Paid",
enableBorder: true
},
};
function createSettingsDomNode(items) {
const settingsDomNode = document.createElement("div");
settingsDomNode.id = "eight-dollars-settings";
settingsDomNode.style.display = "none";
settingsDomNode.innerText = JSON.stringify(items);
document.body.appendChild(settingsDomNode);
}
if (typeof chrome !== "undefined") {
chrome.storage.sync.get(defaultConfig, function (items) {
createSettingsDomNode(items);
});
} else {
createSettingsDomNode(defaultConfig);
}
const s = document.createElement("script", { id: "eight-dollars" });
s.src = chrome.runtime.getURL("script.js");
s.onload = function () {
this.remove();
};
document.head.appendChild(s);