-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgimkit.js
26 lines (21 loc) · 836 Bytes
/
gimkit.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
/// <reference path="chrome.d.ts"/>
chrome.storage.sync.get({
gimkitTranslate: true
}, (items) => {
if (items.gimkitTranslate) {
const target = document.getRootNode()
const cachedAnswers = {}
const observer = new MutationObserver(
() => {
const question = document.querySelector(".sc-kRCAcj > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > span:nth-child(1)").innerText
const answerBoxes = document.querySelector(".sc-cBXKeB").children
}
).observe(document, {childList: true, subtree: true })
observer.observe(target, {
attributes: true,
childList: true,
subtree: true,
childList: true
})
}
});