News for hackers. Stuff that matters.
Re:Custom Properties as State by dennisy on Saturday January 09, 2021 @06:09AM (#25699405)
Can you explain what the issue with this is? What does this circumvent that cannot be done with pure JS?
Re:Custom Properties as State by capableweb on Saturday January 09, 2021 @06:46AM (#25699599)
> Can you explain what the issue with this is?

The only issue I can think of is mixing code/data with styling information. Otherwise there is no "issue" per se.

> What does this circumvent that cannot be done with pure JS?

Nothing, it is just JS after all, and the idea that you can store data in other things than JS variables is not new (jQuery days we stored data in various attributes in the DOM to keep track of state). You could also store the same data in <title/> tag and get the same results. Not sure what the use case is, except it's a fun little hack.

Maybe this will spawn some new JS framework, nothing would surprise me anymore.

Re:Custom Properties as State by rriepe on Saturday January 09, 2021 @06:56AM (#25699645)
If you're trying to make your code look non-malicious, it's easier if you have somewhere to hide the malicious-looking stuff.
Re:Custom Properties as State by dillondoyle on Sunday January 10, 2021 @03:20PM (#25719215)
possibly a longer lasting cache 'super cookie' i made a poc comment below. you could do something similar with a dynamically generated js file but i might wonder if a very small css file with headers like a cdn is cached longer