3 ms·
If "Privacy Badger" blocks cookies, then it's probably the old "The operation is insecure." That's what I see. A message says "Please select up to three locat
by gavinpc 10y ago
If "Privacy Badger" blocks cookies, then it's probably the old "The operation is insecure." That's what I see. A message says "Please select up to three locations," but there is no list of locations.
People, please use a try/catch when feature testing for localStorage. If cookies are blocked for the domain, trying to access storage will throw a security exception. This exception will almost definitely hose whatever behavior you were trying to add. I see this on probably 60% of Show HN projects, but sometimes even on large sites.
Your core competency is testing web sites, right? I'd suggest making one of those 200 locations block cookies. You'll find 10x as many defects.
(edit And I'm assuming that localStorage is almost never really necessary for these sites, but that some bit of the framework tests for it without the developer even realizing it. So yes, I consider that a defect.)
- gavinpc 10y ago...for example, the first Show HN on the front page right now. Doesn't work at all when cookies are blocked—it just renders some stars and some chrome. But okay, I'll run it in another browser. Wow, it's a really cool WebGL visualization of global temperatures. And what is it using localStorage for? It sets one key called `runOnce` to `true`. I think that could be considered optional. Easy to fix, if they knew about it.
- callumprentice 10y agoI'm looking to see if I can fix this now but I don't want to make risky changes while a few people are watching. Will look into it though - Cheers.!
- stevekemp 10y agoIf you're too scared to make changes to your application, that's a great reason to start making sure you have test-cases, and a test-suite. My toy side-project has a full regression test which is executed before any (automated) deploy/upgrade, for precisely this reason.
- kpsychwave 10y agoI think this is for a different app, could you please move the comment there?
- kpsychwave 10y agoMy app uses cookie-based sessions (as does HackerNews), so the authenticated section will not work if you have cookies disabled. I tested in Chrome Win 10, with cookies disabled and privacy badger on and the capture page works fine. I want to debug the issue further to see whats preventing the locations from being displayed. Have you tried clicking on the gear icon? That shows a list of locations.