A rewrite of Poly+, my quality-of-life browser extension for Polytoria. Built entirely fresh using the WXT extension framework, Typescript, and with added better overall code quality.
extension

feat: IRL brick price feature recreation

Index 63066744 b580c60e

Changed files
+24 -1
entrypoints
utils
+13
entrypoints/sitewide.content.ts
···
···
+
import { getUserDetails, bricksToCurrency } from "@/utils/utilities";
+
+
export default defineContentScript({
+
matches: ['*://www.polytoria.com/*'],
+
main() {
+
getUserDetails()
+
.then((user) => {
+
if (!user) return; // Error page or event page most likely, where users are not authenticated
+
const currency = bricksToCurrency(user.bricks, "USD");
+
console.log('wow u have: ', currency);
+
});
+
}
+
});
+1 -1
package.json
···
"name": "polyplus",
"description": "manifest.json description",
"private": true,
-
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "wxt",
···
"name": "polyplus",
"description": "manifest.json description",
"private": true,
+
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "wxt",
+10
utils/currencyPackages.json
···
···
+
{
+
"USD": [
+
[0.99, 100],
+
[4.99, 550],
+
[9.99, 1150],
+
[24.99, 2750],
+
[49.99, 6000],
+
[99.99, 12500]
+
]
+
}