✅ Updated Userscript for Genshin Impact Map — Now Supports markers_all.v4.json
Hi everyone,
I’ve updated my userscript to support the recent filename change on genshin-impact-map.appsample.com, where the marker file is now named markers_all.v4.json.
This version introduces flexible filename matching, allowing the script to work with any marker file that starts with markers_all, regardless of versioning or suffix.
🧠 Key Features
✅ Flexible filename support
✅ Compatible with markers_all.v4.json
✅ Future-proof against file renaming
✅ Enables marker editing and comments
📁 Filename Change Confirmation
Screenshot showing the updated filename on the network request:
✅ Script Working Example
Screenshot showing that the script works correctly with the new marker file:
📝 Userscript Code Sample
// ==UserScript==
// @name GI AppSample Map - More Markable Markers (v4 fix)
// @namespace http://tampermonkey.net/
// @version 1.3
// @description Modifies markers on the Genshin map to be markable and commentable. Also supports new v4.json files.
// @author 2KRN4U
// @match https://genshin-impact-map.appsample.com/*
// @icon https://genshin-impact-map.appsample.com/favicon.ico
// @grant none
// ==/UserScript==
// ... full code here ...
this._filename.startsWith("markers_all"); // ✅ Flexible filename match
// ==UserScript==
// @name GI AppSample Map - More Markable Markers (v4 fix)
// @namespace http://tampermonkey.net/
// @version 1.3
// @description Modifies markers on the Genshin map to be markable and commentable. Also supports new v4.json files.
// @author 2KRN4U + FIX
// @match https://genshin-impact-map.appsample.com/*
// @icon https://genshin-impact-map.appsample.com/favicon.ico
// @grant none
// ==/UserScript==
(function () {
'use strict';
// Comma-separated list of marker IDs to modify – you can change this
const list = "o596, o601, o666, o602, o639, o641, o647, o409, o128, o416 ,o415";
const keys = list.split(",").map(key => key.trim());
// Value that enables marking and commenting – usually 5
const allowMarkComment = 5;
const originalOpen = XMLHttpRequest.prototype.open;
const originalSend = XMLHttpRequest.prototype.send;
// Intercept the request to save the file name
XMLHttpRequest.prototype.open = function (method, url, async, user, password) {
this._filename = url.split('/').pop();
this._url = url;
originalOpen.apply(this, arguments);
};
// Intercept the response and modify it if it's the marker file
XMLHttpRequest.prototype.send = function (body) {
this.addEventListener('readystatechange', function () {
if (
this.readyState === 4 &&
this.status === 200 &&
this._filename &&
this._filename.startsWith("markers_all") // Also catches markers_all.v4.json
) {
try {
let modifiedResponseText = this.responseText;
// Modify the values for specified marker IDs
keys.forEach(key => {
const searchPattern = new RegExp(`("${key}",\\d+,)(\\d+)(,)`, 'g');
modifiedResponseText = modifiedResponseText.replace(
searchPattern,
(_, prefix, lastDigits, suffix) => `${prefix}${allowMarkComment}${suffix}`
);
});
// Override the responseText and response properties
Object.defineProperty(this, 'responseText', {
value: modifiedResponseText,
configurable: true,
});
Object.defineProperty(this, 'response', {
value: modifiedResponseText,
configurable: true,
});
} catch (e) {
console.error('Error while modifying JSON:', e);
}
}
});
originalSend.apply(this, arguments);
};
// After the page loads, modify button tooltips to include data-testid
window.addEventListener('load', function () {
const modifyTitle = (originalTitle, dataTestId) => {
const trimmedData = dataTestId ? dataTestId.slice(4) : 'Unknown';
return `${originalTitle}: ${trimmedData}`;
};
const buttons = document.querySelectorAll('.MuiButtonBase-root');
buttons.forEach(button => {
const originalTitle = button.getAttribute('title');
const dataTestId = button.getAttribute('data-testid');
if (originalTitle && dataTestId) {
const newTitle = modifyTitle(originalTitle, dataTestId);
button.setAttribute('title', newTitle);
}
});
});
})();
✨ Hope this code helped you! 🙏
If it solved your problem or improved your experience with the Genshin Impact map –
I’d really appreciate your feedback, a star ⭐, or any kind of comment!
💡 Have ideas for improvements or updates?
Feel free to update the source code or share your suggestions here. I’m continuously working on improving the script as needed.
🔗 Sharing? Please give credit to 2KRN4U + Hebrew Fix — much appreciated! 🙌
💻 Thanks and enjoy marking!
🎮 Genshin players unite 💚
✅ Updated Userscript for Genshin Impact Map — Now Supports
markers_all.v4.json
Hi everyone,
I’ve updated my userscript to support the recent filename change on genshin-impact-map.appsample.com, where the marker file is now named
markers_all.v4.json
.This version introduces flexible filename matching, allowing the script to work with any marker file that starts with
markers_all
, regardless of versioning or suffix.🧠 Key Features
markers_all.v4.json
📁 Filename Change Confirmation
Screenshot showing the updated filename on the network request:
✅ Script Working Example
Screenshot showing that the script works correctly with the new marker file:
📝 Userscript Code Sample
✨ Hope this code helped you! 🙏
If it solved your problem or improved your experience with the Genshin Impact map –
I’d really appreciate your feedback, a star ⭐, or any kind of comment!
💡 Have ideas for improvements or updates?
Feel free to update the source code or share your suggestions here. I’m continuously working on improving the script as needed.
🔗 Sharing? Please give credit to 2KRN4U + Hebrew Fix — much appreciated! 🙌
💻 Thanks and enjoy marking!
🎮 Genshin players unite 💚