From 85177309d884c247f222cd98235f40ad374fd456 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 30 May 2026 17:18:10 +0100 Subject: [PATCH 1/4] fix: update selector for new giveaway layout --- AWACheck.user.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/AWACheck.user.js b/AWACheck.user.js index 3a1b3ee..5cce332 100644 --- a/AWACheck.user.js +++ b/AWACheck.user.js @@ -22,6 +22,7 @@ const namespace = "AWAKeyChecker:"; const timeout = 5; +const giveawayHookSelector = '.row.accordion-section > .col'; // configuration callbacks function Callbacks() { @@ -1214,7 +1215,7 @@ function check_keys(rgb_enabled) { } // Instructions article - const rightPanel = document.querySelector('article[class*="top-widget"][class*="instructions"] h1:first-of-type'); + const rightPanel = document.querySelector(giveawayHookSelector); // Inject new CSS const style = document.createElement("style"); @@ -1412,7 +1413,7 @@ function check_keys(rgb_enabled) { checkerWidget.innerHTML = checkerWidgetHtml + `

`; // Append the div - rightPanel.insertAdjacentHTML("beforebegin", checkerWidgetHtml); + rightPanel.insertAdjacentHTML("afterbegin", checkerWidgetHtml); } // Wait for variable @@ -1546,7 +1547,7 @@ async function run() { const interval = gmc.get('interval'); try { wait_for_var(() => { - wait_for_el('article[class*="top-widget"][class*="instructions"] h1:first-of-type', () => { + wait_for_el(giveawayHookSelector, () => { check_keys(gmc.get('rgb_enabled')); }, interval) }, interval); From 1dea078e9194b5568b85446591ccf5c96404689c Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 30 May 2026 17:22:21 +0100 Subject: [PATCH 2/4] fix: add Chromium support Tested with Chrome & Opera GX --- AWACheck.user.js | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/AWACheck.user.js b/AWACheck.user.js index 5cce332..1237f16 100644 --- a/AWACheck.user.js +++ b/AWACheck.user.js @@ -18,6 +18,8 @@ // @grant GM.setValue // @grant GM_registerMenuCommand // @compatible Firefox +// @compatible Chrome +// @compatible Opera // ==/UserScript== const namespace = "AWAKeyChecker:"; @@ -1537,23 +1539,25 @@ const logger = (function () { window.logger = logger; // Run -async function run() { - await onInit.add(() => { +function run() { + onInit.add(() => { GM_registerMenuCommand('Settings', () => { gmc.open(); }); - }); - const interval = gmc.get('interval'); - try { - wait_for_var(() => { - wait_for_el(giveawayHookSelector, () => { - check_keys(gmc.get('rgb_enabled')); - }, interval) - }, interval); - } - catch { - throw "AWAKeyChacker: Unknown error"; - } + const interval = Number(gmc.get('interval')) || 1000; + const rgbEnabled = Boolean(gmc.get('rgb_enabled')); + + try { + wait_for_var(() => { + wait_for_el(giveawayHookSelector, () => { + check_keys(rgbEnabled); + }, interval) + }, interval); + } + catch { + throw "AWAKeyChacker: Unknown error"; + } + }); } run(); From e36d4909b6e9545c74b9ea4853778c4e6bdc3a3a Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 30 May 2026 17:26:23 +0100 Subject: [PATCH 3/4] style: visual updates to match new site changes --- AWACheck.user.js | 92 ++++++++++++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 43 deletions(-) diff --git a/AWACheck.user.js b/AWACheck.user.js index 1237f16..7de7f6e 100644 --- a/AWACheck.user.js +++ b/AWACheck.user.js @@ -145,6 +145,8 @@ const gmc = new GM_config( // Key checker function check_keys(rgb_enabled) { + const checkerAccordionId = 'accordion-key-checker'; + const checkerCollapseId = 'collapseKeyChecker'; var country_with_keys = []; var country_without_keys = []; var countries = new function () { @@ -1222,46 +1224,54 @@ function check_keys(rgb_enabled) { // Inject new CSS const style = document.createElement("style"); style.innerText = ` + .js-widget-check-accordion { + margin-bottom: 0.75rem; + } + .js-widget-check { - margin-bottom: 2rem; + margin-bottom: 0.5rem; + padding: 0.75rem !important; + background: rgba(0, 0, 0, 0.2); + border-radius: 0 0 10px 10px; } .js-widget-check > div h5.success { - color: green; + color: #59d17a; font-weight: bold; font-size: 1.15rem; } .js-widget-check > div h5.danger { - color: indianred; + color: #ff7c7c; font-weight: bold; font-size: 1.15rem; } .js-widget-check > div h5.warning { - color: goldenrod; + color: #ffca5f; font-weight: bold; font-size: 1.15rem; } .js-widget-check > div h5.info { - color: darkolivegreen; + color: #8fd4ff; font-weight: bold; font-size: 1.15rem; } .js-widget-check > div p { - padding-top: 5px; - color: #363636; + padding-top: 4px; + color: #d4dae3; } .js-widget-check > div ul { - color: #363636; + color: #d4dae3; + margin-bottom: 0.4rem; } .js-widget-check > div li { border: none !important; - padding: 5px 0; + padding: 2px 0; } .js-widget-check > div:has(img) { @@ -1276,8 +1286,8 @@ function check_keys(rgb_enabled) { .js-widget-check > div hr { border: 0 !important; padding-bottom: 1.5px; - margin-bottom: 1.5rem; - background: hsla(0, 0%, 66%, 0.33); + margin: 0.75rem 0; + background: hsla(0, 0%, 80%, 0.28); } `; @@ -1285,8 +1295,16 @@ function check_keys(rgb_enabled) { if (rgb_enabled) { style.innerText += ` @keyframes animate { + 0% { + background-position: 0% 50%; + } + + 50% { + background-position: 100% 50%; + } + 100% { - filter: hue-rotate(360deg); + background-position: 0% 50%; } } @@ -1297,36 +1315,20 @@ function check_keys(rgb_enabled) { .js-widget-check { display: flex; align-content: center; - background:linear-gradient(135deg, rgba(20, 255, 233, .7), rgba(255, 235, 59, .7), rgba(255, 0, 224, .6), rgba(0, 255, 255, 1)); + background: linear-gradient(135deg, rgba(20, 255, 233, 0.55), rgba(255, 235, 59, 0.45), rgba(255, 0, 224, 0.5), rgba(0, 255, 255, 0.55)); + background-size: 300% 300%; border-radius: 10px; - animation: animate 2.3s linear infinite; + padding: 5px !important; + animation: animate 4s linear infinite; } .js-widget-check > div { width: 100%; - background: rgba(250, 250, 250, .7); - backdrop-filter: blur(50px); - border-radius: 6px; - padding: 5%; - margin: 1.5%; - } - - .js-widget-check > div > h5.success { - background: green; - background-clip: text; - filter: grayscale(0.5) saturate(0.9) sepia(0.4) brightness(1.4) contrast(1.2); - } - - .js-widget-check > div > h5.info { - background-clip: text; - filter: saturate(2) sepia(4.5) brightness(1.1) contrast(3.2); - } - - .js-widget-check > div > h5.danger { - background: deeppink; - color: deeppink; - background-clip: text; - filter: grayscale(0.8) brightness(1.2) saturate(0.8) contrast(0.9) invert(0.8); + background: rgba(22, 27, 34, 0.82); + backdrop-filter: blur(10px); + border-radius: 9px; + padding: 0.75rem; + margin: 0; } .js-widget-check > div hr { @@ -1338,13 +1340,17 @@ function check_keys(rgb_enabled) { style.innerText = style.innerText.replace(/<br>/g, '').replace(/\s\s+/g, ' ').trim(); document.head.append(style); - // Create div - checkerWidget = document.createElement("div"); - // div innerHtml checkerWidgetHtml = ` -
-
+
+
+ +
+
+
+
`; // Availability @@ -1412,7 +1418,7 @@ function check_keys(rgb_enabled) { } } - checkerWidget.innerHTML = checkerWidgetHtml + `

`; + checkerWidgetHtml += `
`; // Append the div rightPanel.insertAdjacentHTML("afterbegin", checkerWidgetHtml); From f399fb8876fcf040ed78134cd06336e6616d0473 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 16 Jul 2026 18:54:23 +0100 Subject: [PATCH 4/4] fix: simplify and harden giveaway layout compatibility --- AWACheck.user.js | 63 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 14 deletions(-) diff --git a/AWACheck.user.js b/AWACheck.user.js index 7de7f6e..6ae13a3 100644 --- a/AWACheck.user.js +++ b/AWACheck.user.js @@ -24,7 +24,23 @@ const namespace = "AWAKeyChecker:"; const timeout = 5; -const giveawayHookSelector = '.row.accordion-section > .col'; +const checkerStyleId = 'awa-key-checker-style'; + +function findGiveawayHook() { + const node = document.querySelector('.row.accordion-section > .col') + || document.querySelector('.accordion-body.js-widget-steps') + || document.querySelector('.giveaway-redemption-steps') + || document.querySelector('.giveaway-instructions-title'); + + return node ? (node.closest('.col') || node.closest('.accordion-wrapper') || node.parentElement) : null; +} + +function hasCountryKeys(countryData) { + if (!countryData || typeof countryData !== 'object') { + return false; + } + return Object.values(countryData).some((value) => Number(value) > 0); +} // configuration callbacks function Callbacks() { @@ -147,6 +163,10 @@ const gmc = new GM_config( function check_keys(rgb_enabled) { const checkerAccordionId = 'accordion-key-checker'; const checkerCollapseId = 'collapseKeyChecker'; + if (document.getElementById(checkerAccordionId)) { + return; + } + var country_with_keys = []; var country_without_keys = []; var countries = new function () { @@ -1202,8 +1222,8 @@ function check_keys(rgb_enabled) { for (var country in countryKeys) { var get_country = countries.getEntry(country); - var get_country_name = get_country.name; - if (countryKeys[country].length === 0) { + var get_country_name = get_country ? get_country.name : country; + if (!hasCountryKeys(countryKeys[country])) { country_without_keys.push(" " + get_country_name); } else { country_with_keys.push(" " + get_country_name); @@ -1219,10 +1239,19 @@ function check_keys(rgb_enabled) { } // Instructions article - const rightPanel = document.querySelector(giveawayHookSelector); + const rightPanel = findGiveawayHook(); + if (!rightPanel) { + throw "AWAKeyChacker: Failed to locate giveaway panel"; + } // Inject new CSS - const style = document.createElement("style"); + let style = document.getElementById(checkerStyleId); + if (!style) { + style = document.createElement("style"); + style.id = checkerStyleId; + document.head.append(style); + } + style.innerText = ` .js-widget-check-accordion { margin-bottom: 0.75rem; @@ -1338,10 +1367,9 @@ function check_keys(rgb_enabled) { ` } style.innerText = style.innerText.replace(/<br>/g, '').replace(/\s\s+/g, ' ').trim(); - document.head.append(style); // div innerHtml - checkerWidgetHtml = ` + let checkerWidgetHtml = `