News for hackers. Stuff that matters.
Re:Goodbye InnerHTML, Hello SetHTML: Stronger XSS Protection... by charcircuit on Tuesday February 24, 2026 @09:36AM (#47137689)
When the condition for when you want to replace is hard to properly specify, AI shines for such find and replaces.
Re:Goodbye InnerHTML, Hello SetHTML: Stronger XSS Protection... by Aachen on Tuesday February 24, 2026 @10:04AM (#47138054)
This one is literally matching "innerHTML = X" and setting "setHTML(X)" instead. Not some complex data format transformation

But I can see what you mean, even if then it would still be better for it to print the code that does what you want (uses a few Wh) than doing the actual transformation itself (prone to mistakes, injection attacks, and uses however many tokens your input data is)

Re:Goodbye InnerHTML, Hello SetHTML: Stronger XSS Protection... by charcircuit on Tuesday February 24, 2026 @11:18AM (#47138948)
That can break the site if you do the find and replace blindly. The goal here is to do the refactor without breaking the site.
Re:Goodbye InnerHTML, Hello SetHTML: Stronger XSS Protection... by lelanthran on Tuesday February 24, 2026 @01:24PM (#47140667)
> When the condition for when you want to replace is hard to properly specify, AI shines for such find and replaces.

And, in your opinion, this is one of those cases?

Re:Goodbye InnerHTML, Hello SetHTML: Stronger XSS Protection... by charcircuit on Tuesday February 24, 2026 @05:35PM (#47144299)
It is because the new API purposefully blocks things the old API did not.