Skip to content

Instantly share code, notes, and snippets.

@OliverBrotchie
Last active November 28, 2021 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OliverBrotchie/b4a5fdb75ed560b0652275be90750f79 to your computer and use it in GitHub Desktop.
Save OliverBrotchie/b4a5fdb75ed560b0652275be90750f79 to your computer and use it in GitHub Desktop.
CSS Values 4 urls exfiltration
.body {
--unique-identifier: 'foo' // unique generated ID
--pointer: 'none'
--theme-preference: 'none'
// Only make one request
background-image: url("/some/url/?" + var(--unique-identifier) + "&" + var(--pointer) + "&" + var(--theme-preference))
}
// Detect pointer type and theme
@media (any-pointer: coarse){
body {
--pointer: 'coarse'
}
}
@media (prefers-color-scheme: dark) {
body {
--theme-preference: 'dark'
}
}
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment