diff --git a/README.md b/README.md index ecf3571..4666ec6 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,19 @@ This plugin syncs missions from the mission creator website to Bannergress. It d The source file creator-plugin-bannergress.user.js can directly be used as plugin in Tampermonkey or IITC button, no compilation required. +## Power-users +Usually the default settings are fine for 99% of use cases, but some users want more. +Adding following to the local storage will skip the confirmation and set the delay between uploads to 500ms: + +| key | value | +|-------------------------------|-------| +| bannergress-skip-confirmation | 1 | +| bannergress-sync-delay | 500 | + +*Caution! These changes may increase the load to the mission creator servers and result unknown restrictions!* + ## Known limitations * The plugin does not sync mission status for missions which have been permanently deleted, since they are not in the user list anymore. * The plugin does not sync mission details when mission details are available in Bannergress. + diff --git a/creator-plugin-bannergress.user.js b/creator-plugin-bannergress.user.js index 1639be2..dfacfda 100644 --- a/creator-plugin-bannergress.user.js +++ b/creator-plugin-bannergress.user.js @@ -4,7 +4,7 @@ // @author The Bannergress team // @match https://missions.ingress.com/* // @match https://bannergress.com/* -// @version 1.1 +// @version 1.2 // @namespace https://github.com/bannergress/creator-plugin // @updateURL https://bannergress.com/creator-plugin-bannergress.user.js // @downloadURL https://bannergress.com/creator-plugin-bannergress.user.js @@ -90,7 +90,9 @@ try { ui.progress(`Requesting missions for banner ${slug}...`); const missionIds = await getMissionIds(slug); - if (await ui.confirm(`Sync ${missionIds.length} missions with ${bannergressTitle}?`)) { + const skipConfirmation = window.localStorage.getItem("bannergress-skip-confirmation"); + const confirmed = (skipConfirmation === "true" || skipConfirmation === "1") || await ui.confirm(`Sync ${missionIds.length} missions with ${bannergressTitle}?`); + if (confirmed) { ui.progress("Logging in..."); const user = await getUser(); await refreshMissions(ui, user, missionIds); @@ -129,7 +131,12 @@ async function rateLimit(ui) { ui.progress(`Waiting for next step...`); await rateLimiter; - rateLimiter = sleep(1000); + let delay = parseInt(window.localStorage.getItem("bannergress-sync-delay") || "1000", 10); + if (isNaN(delay) || delay < 0) { + console.warn("[Bannergress Plugin] Invalid bannergress-sync-delay, falling back to 1000ms"); + delay = 1000; + } + rateLimiter = sleep(delay); }