This repository was archived by the owner on Mar 3, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathabandonedScript.js
More file actions
82 lines (71 loc) · 3.35 KB
/
Copy pathabandonedScript.js
File metadata and controls
82 lines (71 loc) · 3.35 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// ==UserScript==
// @name Rom Download on RA Hash List (PROJECT ABANDONED)
// @namespace https://github.com/MentalBlank/RARomOnHashes
// @updateURL https://raw.githubusercontent.com/MentalBlank/RARomOnHashes/main/abandonedScript.js
// @downloadURL https://raw.githubusercontent.com/MentalBlank/RARomOnHashes/main/abandonedScript.js
// @version 1.2.0
// @description OFFICIALLY ABANDONED due to Myrient closure. This script will now clear its local cache and stop running.
// @author MentalBlank
// @match https://retroachievements.org/*
// @icon https://static.retroachievements.org/assets/images/favicon.webp
// @grant none
// @run-at document-end
// ==/UserScript==
(function() {
'use strict';
// 1. CLEAR STORAGE: Deletes the IndexedDB 'RAHashCache' used by the original script
const DB_NAME = 'RAHashCache';
const LS_KEYS = [
'RAHashCache',
'collectionLastModified',
'collectionLastUpdated',
'collectionROMList'
];
try {
LS_KEYS.forEach(key => {
if (localStorage.getItem(key)) {
localStorage.removeItem(key);
console.log(`[Storage] LocalStorage key "${key}" removed.`);
}
});
const deleteRequest = window.indexedDB.deleteDatabase(DB_NAME);
deleteRequest.onsuccess = () => console.log(`[Storage] IndexedDB "${DB_NAME}" deleted successfully.`);
deleteRequest.onblocked = () => console.warn(`[Storage] Deletion blocked. Please close other tabs.`);
} catch (e) {
console.error("[Storage] Error clearing local data:", e);
}
// 2. DISPLAY NOTICE: Informs the user why the script is dead and prompts uninstallation
function injectAbandonmentNotice() {
const hashList = document.querySelector('ul[data-testid="named-hashes"]');
if (!hashList) return;
const listItems = hashList.querySelectorAll('li');
listItems.forEach(li => {
if (li.dataset.scriptStatusInjected) return;
li.dataset.scriptStatusInjected = "true";
const container = li.querySelector("div.border-l-2");
if (container) {
const notice = document.createElement('div');
notice.style.marginTop = "8px";
notice.style.padding = "10px";
notice.style.backgroundColor = "#450a0a";
notice.style.border = "2px solid #f87171";
notice.style.borderRadius = "4px";
notice.style.color = "#fca5a5";
notice.style.fontSize = "0.9rem";
notice.style.fontWeight = "bold";
notice.style.lineHeight = "1.4";
notice.innerHTML = `
⚠️ PROJECT ABANDONED<br>
<span style="font-weight:normal; font-style:italic; font-size:0.8rem;">
Due to the closure of Myrient, The Tampermonkey "Rom Download on RA Hash List" script is no longer maintained.<br>
<strong>Please uninstall this script from your manager.</strong>
</span>
`;
container.appendChild(notice);
}
});
}
const observer = new MutationObserver(injectAbandonmentNotice);
observer.observe(document.body, { childList: true, subtree: true });
injectAbandonmentNotice();
})();