CrookedStyleSheets icon indicating copy to clipboard operation
CrookedStyleSheets copied to clipboard

tracking multiple clicks/hovers/events

Open notVitaliy opened this issue 6 years ago • 10 comments

You can have the track.php script return a 404. The browser won't cache the response and attempt to get it again on the next event.

notVitaliy avatar Jan 16 '18 17:01 notVitaliy

Ok, i will test it and try to implement this.

jbtronics avatar Jan 16 '18 17:01 jbtronics

I tried this and it didnt worked for me (in Chrome and Firefox). I tried some other status codes and some cache control headers, but i was not able to have the browser request a css url multiple times...

jbtronics avatar Jan 16 '18 19:01 jbtronics

Strange. I was able to get it to work locally. I'll take a look again tomorrow.

notVitaliy avatar Jan 18 '18 07:01 notVitaliy

Browsers will tend to remember a 404 and serve the response from the cache if possible. If the content isn't available it may well default to the internal error page. Returning a 200 with valid (but unused) content, like some empty dummy class or maybe even empty string would prevent the request showing up as an invalid one in the console.

102 and 202 look like fun responses to subvert though 304 (commonly seen, so easily ignored) might be a sneakier option.

ShirtlessKirk avatar Jan 18 '18 12:01 ShirtlessKirk

maybe you could work on cache controlling header on server side Cache-control: private, max-age=0, no-cache E-tag etc.

lury avatar Jan 20 '18 16:01 lury

I think this does not matter with the cache. Firstly, we should focus on how to trigger request css resources repeatedly but not on how to disable the cache.

diamont1001 avatar Jan 23 '18 09:01 diamont1001

@diamont1001 By not allowing the resource to be cached by the browser it will try to get the resource again the next time that it's requested.

We're not talking about caching the resource across browser page loads and reloads. This is about not letting the browser cache the resource at all.

notVitaliy avatar Jan 25 '18 22:01 notVitaliy

@notVitaliy OK, maybe we should try the following steps first:

  1. set background-image: url(xxx); to <a> in demo page, for example:
a.btn:hover {
  background-image: url(xxxxxxxx);
}
  1. open dev-tools and load demo page in browser
  2. clear the browser's cache (all)
  3. Move your mouse over the <a> again and again
  4. check the 'network' in dev-tools

diamont1001 avatar Jan 26 '18 02:01 diamont1001

maybe you should split this into two issues - one for php server code and one for css?

lury avatar Jan 26 '18 09:01 lury

@notVitaliy Seems its not posible to fetch URL(X) each time on focus in single session.

Im write some code (at https://github.com/Bogdaan/spycss-demo), and try almost all HTTP/1.1 codes. Browser always cache first response in single session. Only after page refresh it can be downloaded again.

Bogdaan avatar Feb 02 '18 12:02 Bogdaan