0
0
mirror of https://github.com/Maks1mS/userscripts.git synced 2025-03-20 17:23:54 +03:00

[SteamPriceConverter] update to 0.3

- add timeout and source price viewing (#1)
This commit is contained in:
KaMZeSs 2024-06-22 23:23:29 +03:00 committed by GitHub
parent 32a4239fe4
commit db9d93407d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name Steam Price Converter // @name Steam Price Converter
// @namespace https://github.com/Maks1mS/userscripts // @namespace https://github.com/Maks1mS/userscripts
// @version 0.2 // @version 0.3
// @description Converts prices to rubles // @description Converts prices to rubles
// @author Maxim Slipenko // @author Maxim Slipenko
// @match https://store.steampowered.com/* // @match https://store.steampowered.com/*
@ -62,6 +62,8 @@
return; return;
} }
setTimeout(75);
const convert = (n) => +(n * rates[source_valute].value).toFixed(2); const convert = (n) => +(n * rates[source_valute].value).toFixed(2);
replace(convert); replace(convert);
@ -74,7 +76,8 @@
for (let i = 0; i < r.snapshotLength; i++) { for (let i = 0; i < r.snapshotLength; i++) {
let n = r.snapshotItem(i); let n = r.snapshotItem(i);
const value = parseFloat(n.textContent.replace(" ", "").replace(',', '.')) const value = parseFloat(n.textContent.replace(" ", "").replace(',', '.'))
n.replaceWith(`${convert(value)}`);
n.replaceWith(`${convert(value)} ₽ / ${value} ${state.source_symbol}`);
console.log(n) console.log(n)
} }
} }