1

Recently, I had trouble accessing the Next Soundcloud. No matter which url I tried, the general error page appeared, telling me something went wrong and recommending modern browsers.

The browser console said that the app failed when accessing window.localStorage:

TypeError: localStorage is null

Indeed, I had dom.storage globally disabled in my Firefox config. There may be other users out there who are using a modern browser but have dom.storage disabled and thus may feel left alone with this generic error page.

I'd appreciate something like an alert box that informs the users about missing support for that particular feature. Try this fiddle with dom.storage disabled/enabled. It's implemented in a few minutes but makes the user experience way better, I think.

So, are there already some kind of specific error pages being planned for Soundcloud?

Sam Hanley
  • 4,707
  • 7
  • 35
  • 63
schwarztee
  • 11
  • 2
  • 2
    This question appears to be off-topic because SO is not Soundcloud’s bug tracking or feature request system. – CBroe Feb 13 '14 at 21:23
  • Right, sorry for the inconvenience. I mailed the Soundcloud support directly, we'll see what comes out. :) – schwarztee Feb 14 '14 at 10:19

1 Answers1

0

From reading your question, it's not entirely clear to me if you want to check for localStorage support, or specificity check if someone has the dom.storage setting enabled/disabled in Firefox.

Checking for localStorage support is fairly easy:

function hasLocalStorage() {
    return window.localStorage && !!window.localStorage.getItem
}

Modernizr is a fairly popular library which contains a bunch of tests, and some polyfills.

As for checking dom.storage, no, that will never be possible. It would be a serious security/privacy problem if a website would be able to read settings from the browser. The last few years browsers have moved to providing less information to servers, not more.
See this page for example.

The best you can do is check for localStorage support, and if it's not available, display a help page with instructions for all the browsers.

Martin Tournoij
  • 26,737
  • 24
  • 105
  • 146
  • I'm sorry, confusion was not intended. This question is actually addressing the Soundcloud dev team or anyone who is involved in their front-end development. The feature detection itself was not my concern (viewed the fiddle?), but whether the Soundcloud guys are going to add concrete error pages. – schwarztee Feb 13 '14 at 21:06
  • Maybe I got it wrong, the [SoundCloud dev support](http://developers.soundcloud.com/support) pointed me here to ask my question. ;) – schwarztee Feb 13 '14 at 21:07
  • @schwarztee Right. Carefully re-reading your question, I see you're trying to address a specific SoundCloud problem/bug/feature. This sort of question is so unexpected, I missed that. I can't venture a guess why a support rep from soundcloud would send you here, this site is a question & answer site for programmers. – Martin Tournoij Feb 13 '14 at 21:40
  • Sorry for the inconvenience. The developers' support page is a bit misleading, they just want to have discussion about their api functions on SO. I mailed the Soundcloud support directly, we'll see what comes out. Anyway, thanks for your time. – schwarztee Feb 14 '14 at 10:23