News for hackers. Stuff that matters.
Re:uBlock, I exfiltrate: exploiting ad blockers with CSS by badsectoracula on Monday December 06, 2021 @06:22PM (#29467087)
In theory XHTML was nice as it allowed easier parsing of pages, but in practice it was doomed to fail from the moment a single bracket off made entire sites to stop working. That W3C put their hands in their ears going all lalalalala while ignoring how the world actually used HTML is what led to their irrelevance in defining HTML and essentially giving control to Google, et al.

IMO the "robustness principle" is a good thing because it realizes that people make mistakes and their goal isn't to make something correct but something that produces the results they want to see. Even if browsers started with XHTML-like strictness with no alternative, that strictness would quickly have eroded during the first browser wars.

Re:uBlock, I exfiltrate: exploiting ad blockers with CSS by xpressvideoz on Monday December 06, 2021 @06:58PM (#29467450)
And after all these years, those people surrendered and started to stick to mandatory closing tags when React was introduced, proving XHTML was right. How amusing.
Re:uBlock, I exfiltrate: exploiting ad blockers with CSS by wnevets on Monday December 06, 2021 @08:07PM (#29467982)
> And after all these years, those people surrendered and started to stick to mandatory closing tags when React was introduced, proving XHTML was right.

I would argue HTML has been way more successful than React and thus XHTML hasn't been proven right.

Re:uBlock, I exfiltrate: exploiting ad blockers with CSS by fregante on Tuesday December 07, 2021 @12:27AM (#29469321)
JSX requires a build though, it's easier to enforce syntax when a missing character will just work while writing it. There are no JSX errors at runtime for this reason.
Re:uBlock, I exfiltrate: exploiting ad blockers with CSS by nauticacom on Monday December 06, 2021 @07:36PM (#29467740)
Yes, because everybody has willingly surrendered to the horrors of React hegemony
Re:uBlock, I exfiltrate: exploiting ad blockers with CSS by aaaaaaaaaaab on Monday December 06, 2021 @07:54PM (#29467894)
Delete a semicolon from a C/C++/Java/C# program, and it won’t compile.

Delete a byte from a zip file, and it won’t unzip.

I don’t see why HTML should be different…

Re:uBlock, I exfiltrate: exploiting ad blockers with CSS by FridgeSeal on Tuesday December 07, 2021 @04:47AM (#29470678)
Yeah I don’t see how that is supposed to be a benefit?

Why _shouldn’t_ people have to make actually-valid-html? We don’t tolerate “only sort of correct JSON” tightening the acceptable requirements for valid HTML and CSS would likely make using those formats in more places _easier_.

Re:uBlock, I exfiltrate: exploiting ad blockers with CSS by badsectoracula on Wednesday December 08, 2021 @08:53AM (#29484678)
Compiling is something that happens locally and is static - it either compiles now or it doesn't and once you have the final executable you can distribute to your users the syntactical errors or whatever of your source code doesn't matter after that.

HTML is different because it is parsed by the browser the end user is using when it is using it. If a site completely broke like, f.e. how Mozilla treated bad XHTML sites (instead of showing the site itself you'd get some yellow page with the error) when you got a tiny syntax error then anything with user generated content (forums, blogs, etc) or even just generated could be a potential minefield. Especially as websites started adding code from external sources (be it for ads or for things like youtube embeds or whatever).

Re:uBlock, I exfiltrate: exploiting ad blockers with CSS by Sohcahtoa82 on Monday December 06, 2021 @07:34PM (#29467721)
> but in practice it was doomed to fail from the moment a single bracket off made entire sites to stop working.

Maybe the solution was to not publish sites that are a bracket off.

I think half the problems with JavaScript are because of its weak typing. 1 + {} should be a type error.

Re:uBlock, I exfiltrate: exploiting ad blockers with CSS by zerocount on Tuesday December 07, 2021 @01:39AM (#29469640)
No, half the problems with JavaScript are because people refuse to learn it. Just don't write 1+{}. Every time people start bashing JavaScript, it's with these odd-ball examples that they make up.
Re:uBlock, I exfiltrate: exploiting ad blockers with CSS by tadfisher on Tuesday December 07, 2021 @01:50AM (#29469693)
And this is how add_two_numbers becomes embedded in the node_modules of 73,000 projects on GitHub.

It's okay if JS has warts, but denying they exist doesn't help anyone.

Re:uBlock, I exfiltrate: exploiting ad blockers with CSS by Akronymus on Tuesday December 07, 2021 @09:58AM (#29473082)
If JS just had stuck to LISP like syntax it'd be quite a bit more usable IMO.