perfectionist-plugins 2.4.4 → 2.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/auto-accept.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const PLUGIN_ID = "auto-accept";
2
- export const version = "1.1.1";
2
+ export const version = "1.1.2";
3
3
 
4
4
  const PHASE_URI = "/lol-gameflow/v1/gameflow-phase";
5
5
  const READY_CHECK_URI = "/lol-matchmaking/v1/ready-check";
@@ -9,6 +9,7 @@ const DELAY_KEY = "perfectionist:auto-accept:delay";
9
9
  const MAX_DELAY = 15000;
10
10
  const RETRY_MS = 700;
11
11
  const MAX_ATTEMPTS = 4;
12
+ const GAME_SELECT_GUARD_MS = 1500;
12
13
  const STYLE_ID = "perf-auto-accept-style";
13
14
  const ROOT_ID = "perfAutoAccept";
14
15
  const TOGGLE_ID = "perfAutoAcceptToggle";
@@ -244,6 +245,8 @@ function buildButton() {
244
245
  }
245
246
 
246
247
  let buttonRetry = null;
248
+ let gameSelectGuardUntil = 0;
249
+ let gameSelectClickHandler = null;
247
250
 
248
251
  function footer() {
249
252
  return (
@@ -253,6 +256,7 @@ function footer() {
253
256
  }
254
257
 
255
258
  function gameSelectOpen() {
259
+ if (Date.now() < gameSelectGuardUntil) return true;
256
260
  try {
257
261
  return !!document.querySelector(".parties-game-select-screen.game-select-show");
258
262
  } catch {
@@ -260,6 +264,15 @@ function gameSelectOpen() {
260
264
  }
261
265
  }
262
266
 
267
+ function onGameSelectClick(event) {
268
+ const target = event.target;
269
+ if (!(target instanceof Element)) return;
270
+ if (!target.closest(".parties-game-select-screen, .play-button-container, .lobby-back-button")) return;
271
+ gameSelectGuardUntil = Date.now() + GAME_SELECT_GUARD_MS;
272
+ clearTimeout(buttonRetry);
273
+ buttonRetry = setTimeout(ensureButton, GAME_SELECT_GUARD_MS + 100);
274
+ }
275
+
263
276
  function ensureButton() {
264
277
  if (!active) return;
265
278
  clearTimeout(buttonRetry);
@@ -290,6 +303,10 @@ function onEnable(utils) {
290
303
  domObserver = new MutationObserver(scheduleEnsure);
291
304
  domObserver.observe(document.documentElement ?? document, { childList: true, subtree: true });
292
305
 
306
+ gameSelectClickHandler = onGameSelectClick;
307
+ document.addEventListener("pointerdown", gameSelectClickHandler, true);
308
+ document.addEventListener("click", gameSelectClickHandler, true);
309
+
293
310
  for (const uri of [PHASE_URI, READY_CHECK_URI]) {
294
311
  try {
295
312
  const off = utils.subscribe(uri, uri === PHASE_URI ? onPhase : onReadyCheck);
@@ -316,6 +333,12 @@ function onDisable() {
316
333
  domTimer = null;
317
334
  clearTimeout(buttonRetry);
318
335
  buttonRetry = null;
336
+ if (gameSelectClickHandler) {
337
+ document.removeEventListener("pointerdown", gameSelectClickHandler, true);
338
+ document.removeEventListener("click", gameSelectClickHandler, true);
339
+ }
340
+ gameSelectClickHandler = null;
341
+ gameSelectGuardUntil = 0;
319
342
  document.getElementById(ROOT_ID)?.remove();
320
343
  removeStyle?.();
321
344
  removeStyle = null;
@@ -337,7 +360,6 @@ export function init() {
337
360
  description:
338
361
  "Accepts the ready check automatically, with an optional delay. The same switch is shown natively in the lobby footer.",
339
362
  version,
340
- defaultEnabled: true,
341
363
  options: [
342
364
  {
343
365
  key: OPTION_KEY,
@@ -360,4 +382,4 @@ export function init() {
360
382
  addEventListener("perfectionist:utils-ready", (event) => registerWith(event.detail ?? window.PerfectionistUtils), {
361
383
  once: true,
362
384
  });
363
- }
385
+ }
package/auto-claimer.js CHANGED
@@ -362,7 +362,6 @@ export function init() {
362
362
  name: "Auto Claimer",
363
363
  description: "Automatically claims battle pass, event and mission rewards the moment they become claimable.",
364
364
  version,
365
- defaultEnabled: true,
366
365
  options: [
367
366
  {
368
367
  key: "buy1Be",
@@ -402,4 +401,4 @@ export function init() {
402
401
  return;
403
402
  }
404
403
  addEventListener("perfectionist:utils-ready", (e) => registerWith(e.detail ?? window.PerfectionistUtils), { once: true });
405
- }
404
+ }
package/auto-read.js CHANGED
@@ -358,7 +358,6 @@ export function init() {
358
358
  name: "Auto Read",
359
359
  description: "Automatically marks quests, loot, Clash, TFT and client notices as read so no badge or dot stays lit.",
360
360
  version,
361
- defaultEnabled: true,
362
361
  options: [
363
362
  {
364
363
  type: "chips",
@@ -388,4 +387,4 @@ export function init() {
388
387
  return;
389
388
  }
390
389
  addEventListener("perfectionist:utils-ready", (e) => registerWith(e.detail ?? window.PerfectionistUtils), { once: true });
391
- }
390
+ }
package/ban-blocker.js CHANGED
@@ -632,7 +632,6 @@ export function init() {
632
632
  name: "Ban Blocker",
633
633
  description: "During bans, blocking a teammate instantly claims the champion they hover to ban.",
634
634
  version,
635
- defaultEnabled: true,
636
635
  onEnable,
637
636
  onDisable,
638
637
  });
@@ -647,4 +646,4 @@ export function init() {
647
646
  (e) => registerWith(e.detail ?? window.PerfectionistUtils),
648
647
  { once: true },
649
648
  );
650
- }
649
+ }
package/better-client.js CHANGED
@@ -286,8 +286,6 @@ function createFetch(env) {
286
286
  storeInCache(key, ttl, response);
287
287
  }, () => {});
288
288
  }
289
- // Every caller gets its own clone; the original response stays unread so
290
- // concurrent callers can clone it after one caller consumes the body.
291
289
  return request.then((response) => (response?.clone ? response.clone() : response));
292
290
  }
293
291
 
@@ -780,7 +778,6 @@ export function init() {
780
778
  description:
781
779
  "Debloats the client: blocks telemetry and analytics calls, merges duplicate requests, caches static client data, decodes images asynchronously and keeps settings, chat and friend requests usable during a game.",
782
780
  version,
783
- defaultEnabled: true,
784
781
  options: OPTIONS,
785
782
  onEnable,
786
783
  onDisable,
@@ -793,4 +790,4 @@ export function init() {
793
790
  return;
794
791
  }
795
792
  addEventListener("perfectionist:utils-ready", (e) => registerWith(e.detail ?? window.PerfectionistUtils), { once: true });
796
- }
793
+ }
package/dodge-helper.js CHANGED
@@ -545,7 +545,6 @@ export function init() {
545
545
  description:
546
546
  "Adds a DODGE/QUIT button to champion select: DODGE with the estimated LP loss for ranked queues, QUIT for every other mode. Hidden when the client already shows its own QUIT button.",
547
547
  version,
548
- defaultEnabled: true,
549
548
  onEnable,
550
549
  onDisable,
551
550
  });
@@ -558,4 +557,4 @@ export function init() {
558
557
  addEventListener("perfectionist:utils-ready", (event) => registerWith(event.detail ?? window.PerfectionistUtils), {
559
558
  once: true,
560
559
  });
561
- }
560
+ }
@@ -361,7 +361,6 @@ let topLevelOrder = [];
361
361
  let ownedTopLevelIds = null;
362
362
  let currentChampionId = null;
363
363
  let carouselOrder = [];
364
- let selectedSkinId = null;
365
364
  let failure = null;
366
365
  let requestToken = 0;
367
366
  let refreshTimer = null;
@@ -371,7 +370,6 @@ let selectInFlight = false;
371
370
  let sessionMisses = 0;
372
371
  let championMisses = 0;
373
372
  let renderObserver = null;
374
- const skinSuffixCache = new Map();
375
373
  let removeStyle = null;
376
374
 
377
375
  function logError(scope, error) {
@@ -536,7 +534,6 @@ function nextOwnedSkin(owned, fromId, direction) {
536
534
  }
537
535
 
538
536
  async function selectSkin(skinId) {
539
- selectedSkinId = skinId;
540
537
  selectInFlight = true;
541
538
  const guard = setTimeout(() => {
542
539
  selectInFlight = false;
@@ -556,7 +553,6 @@ function resetState() {
556
553
  topLevelOrder = [];
557
554
  ownedTopLevelIds = null;
558
555
  currentChampionId = null;
559
- selectedSkinId = null;
560
556
  carouselOrder = [];
561
557
  clientSkinOrder = [];
562
558
  failure = null;
@@ -576,7 +572,7 @@ function loadChampion(championId) {
576
572
  const token = ++requestToken;
577
573
 
578
574
  Promise.all([loadOwnedSkins(championId), loadCarouselOrder()]).then(
579
- ([{ owned, order: inventoryOrder, topLevel, ownedTopLevel, entries }, carouselIds]) => {
575
+ ([{ owned, order: inventoryOrder, topLevel, ownedTopLevel }, carouselIds]) => {
580
576
  if (token !== requestToken) return;
581
577
  ownedSkinIds = owned;
582
578
  allSkinIds = new Set(inventoryOrder);
@@ -613,8 +609,6 @@ function updateForSession(session, selection) {
613
609
  if (ownedSkinIds === null) return;
614
610
 
615
611
  const serverSkinId = selection?.selectedSkinId || me.selectedSkinId || null;
616
- const belongsToChampion = serverSkinId !== null && Math.floor(serverSkinId / 1000) === championId;
617
- if (!selectInFlight && belongsToChampion) selectedSkinId = serverSkinId;
618
612
 
619
613
  const knownUnownedSkin = allSkinIds !== null && allSkinIds.has(serverSkinId) && !ownedSkinIds.has(serverSkinId);
620
614
  if (!selectInFlight && knownUnownedSkin) {
@@ -697,7 +691,6 @@ export function init() {
697
691
  name: "Hide Unowned Skins",
698
692
  description: "In champion select, only shows the skins you own for the picked champion.",
699
693
  version,
700
- defaultEnabled: true,
701
694
  onEnable,
702
695
  onDisable,
703
696
  });
@@ -708,4 +701,4 @@ export function init() {
708
701
  } else {
709
702
  addEventListener("perfectionist:utils-ready", (event) => registerWith(event.detail), { once: true });
710
703
  }
711
- }
704
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perfectionist-plugins",
3
- "version": "2.4.4",
3
+ "version": "2.4.5",
4
4
  "description": "Small plugins that fix the annoying parts of League of Legends champ select. Built for Pengu Loader.",
5
5
  "type": "module",
6
6
  "main": "perfectionist-utils.js",