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
1import { bricksToCurrency } from "@/utils/utilities"; 2 3export function irlBrickPrice() { 4 const purchaseBtn = document.querySelector('button[onclick^="buy"], button[data-price]')!; 5 const currency = bricksToCurrency(parseInt(purchaseBtn.getAttribute('data-price')!), "USD"); 6 7 if (currency) { 8 const spanTag = document.createElement('span'); 9 spanTag.classList.add('text-muted'); 10 spanTag.style.fontSize = '0.7rem'; 11 spanTag.style.fontWeight = 'lighter'; 12 spanTag.innerText = ` (${currency})`; 13 purchaseBtn.appendChild(spanTag); 14 }; 15};