#javascript 3 articles
- A trailing-whitespace regex freezes the page when it parses AI outputgotchas / spfx/\s+$/ and lazy (.+?)\s*$ are quadratic on a line with a long run of spaces that does not end the line; text from an AI model or a foreign document is untrusted input, so trim with trimEnd() and anchor captures on a…
- Enumerate every site from the browser console (no admin API, no tooling)gotchas / searchcontentclass:STS_Site OR STS_Web over Search REST lists every web the account can read, no admin role or tooling; plus the traps of a cross-site F12 sweep (Hidden filter, case-sensitive GetList, 400 vs 404, per-web…
- Upload a generated image as a list item attachment (no file picker)snippets / restCanvas charts, placeholder banners, QR codes — AttachmentFiles/add takes a raw ArrayBuffer; the item must exist first