forked from FiftyNine/scpper-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwikiMain.js
36 lines (33 loc) · 1.41 KB
/
wikiMain.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
// Process loaded page
function processWiki() {
if (scpWebsite==null)
return false;
injectExtensionScript("constants.js");
injectExtensionScript("scpEventOverrides.js");
if (checkIfForum())
processForumPage();
else {
processWikiPage();
retrievePageInfo();
}
overrideUserInfoLinks();
// overrideWikiBottomButtons();
return true;
}
// Listen to messages from the page
document.addEventListener('ScpperExternalMessage', function(event) {
if (event.detail.text == "USER_INFO_DIALOG_EXTERNAL")
// chrome.tabs.sendMessage(sender.tab.id, {text: "USER_INFO_DIALOG_INTERNAL", userName: event.detail.userName, userId: event.detail.userId})
processUserInfoDialog(event.detail.userName, event.detail.userId)
else if (event.detail.text == "HISTORY_MODULE_LOADED_EXTERNAL")
// chrome.tabs.sendMessage(sender.tab.id, {text: "HISTORY_MODULE_LOADED_INTERNAL"})
historyModuleLoaded()
else if (event.detail.text == "ACTION_AREA_UPDATED_EXTERNAL") {
// chrome.tabs.sendMessage(sender.tab.id, {text: "ACTION_AREA_UPDATED_INTERNAL"})
overrideHistoryModuleUpdateRevisionListPageButtons();
overrideUserInfoLinks();
}
else if (event.detail.text == "PAGERATE_MODULE_LOADED_EXTERNAL")
// chrome.tabs.sendMessage(sender.tab.id, {text: "PAGERATE_MODULE_LOADED_INTERNAL"})
overrideShowVotersButton();
});