-
Notifications
You must be signed in to change notification settings - Fork 0
/
iitc-bannergress-automatic-missions-uploader.user.js
44 lines (40 loc) · 1.72 KB
/
iitc-bannergress-automatic-missions-uploader.user.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
// ==UserScript==
// @name IITC Plugin: Bannergress automatic missions uploader
// @id missions-plugin-bannergress-automatic-upload
// @category Misc
// @version 0.2
// @updateURL https://github.com/KirDE/iitc-plugin-bannergress-automatic-upload/raw/main/iitc-bannergress-automatic-missions-uploader.user.js
// @downloadURL https://github.com/KirDE/iitc-plugin-bannergress-automatic-upload/raw/main/iitc-bannergress-automatic-missions-uploader.user.js
// @author KirillDE
// @description Automatically uploads new found missions to bannergress after area scan or opening mission link.
// @match https://intel.ingress.com/*
// @match https://intel-x.ingress.com/*
// @grant none
// ==/UserScript==
function wrapper(pluginInfo) {
uploadMissions();
}
function uploadMissions() {
jQuery(".bannerIndexer-mission-status-new").trigger('click');
setTimeout(uploadMissions, 1000);
}
((() => {
const pluginInfo = {};
if (typeof GM_info !== 'undefined' && GM_info && GM_info.script) {
pluginInfo.script = {
version: GM_info.script.version,
name: GM_info.script.name,
description: GM_info.script.description,
};
}
// Greasemonkey. It will be quite hard to debug
if (typeof unsafeWindow !== 'undefined' || typeof GM_info === 'undefined' || GM_info.scriptHandler != 'Tampermonkey') {
// inject code into site context
const script = document.createElement('script');
script.appendChild(document.createTextNode(`(${wrapper})(${JSON.stringify(pluginInfo)});`));
(document.body || document.head || document.documentElement).appendChild(script);
} else {
// Tampermonkey, run code directly
wrapper(pluginInfo);
}
})());