sebthedev/PrincetonCourses

Search Doesn't Work on Safari in Private Browsing

Opened this issue · 0 comments

On both desktop and mobile Safari, search doesn't work when the user is browsing with Private Browsing. This is because Safari throws a JavaScript error on any attempt to read/write to localStorage if the user is in Private Browsing. Specifically, when searching, search.js:70 throws an error QuotaExceededError (DOM Exception 22): The quota has been exceeded. This JavaScript error causes the searching operation to abort. Googling confirms this is a thing that Safari does – it's not just us!

To fix this, we could make use of try/catch statements around all localStorage calls to ensure that even if the call to localStorage fails, the rest of the action continues.

This is probably not an imminently urgent bug because of the relatively few people who will be using Princeton Courses on with Private Browsing enabled.