{"id":1172430,"date":"2016-10-04T11:57:02","date_gmt":"2016-10-04T18:57:02","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/hard-dependency-on-local-storage-breaks-page-in-ios-private-browsing\/"},"modified":"2016-10-05T15:46:52","modified_gmt":"2016-10-05T22:46:52","slug":"hard-dependency-on-local-storage-breaks-page-in-ios-private-browsing","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/hard-dependency-on-local-storage-breaks-page-in-ios-private-browsing\/","title":{"rendered":"Hard Dependency on Local Storage Breaks Page in iOS Private Browsing"},"content":{"rendered":"<p>Hello,<\/p>\n<p>It looks like the filterbar has a hard dependency on local storage insofar as it fails to check if local storage is available before attempting to use it. It has the following conditional:<\/p>\n<p><code>tribe_storage&amp;&amp;tribe_storage.setItem(\"tribe_events_filters_wrapper\",\"closed\")<\/code><\/p>\n<p>iOS private browsing mode disables local storage. When the filterbar is used on iOS in private browsing mode, the script throws an error, which prevents other JavaScript on the page from running thereby breaking the page.<\/p>\n<p>Here is the error it throws:<\/p>\n<p><code><br \/>\n[Error] QuotaExceededError: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota.<br \/>\n\tsetItem (filter-scripts-shim.min.js:12:1629)<br \/>\n\tn (filter-scripts-shim.min.js:12:1629)<br \/>\n\t(anonymous function) (filter-scripts-shim.min.js:12:4013)<br \/>\n\ti (jquery.js:2:27455)<br \/>\n\tfireWith (jquery.js:2:28215)<br \/>\n\tready (jquery.js:2:30018)<br \/>\n\tK (jquery.js:2:30374)<br \/>\n<\/code><\/p>\n<p>As a temporary fix, I have had to dequeue the script and enqueue a &#8220;shimmed&#8221; version with the following function added and with the check changed:<\/p>\n<p><code><br \/>\n\/\/ added this function<br \/>\nfunction hasLocalStorage(){<br \/>\n  var test = 'test';<br \/>\n  try {<br \/>\n    localStorage.setItem(test, test);<br \/>\n    localStorage.removeItem(test);<br \/>\n    return true;<br \/>\n  } catch(e) {<br \/>\n    return false;<br \/>\n  }<br \/>\n}<br \/>\n\/\/ modified the check<br \/>\nhasLocalStorage()&amp;&amp;tribe_storage&amp;&amp;tribe_storage.setItem(\"tribe_events_filters_wrapper\",\"closed\")<br \/>\n<\/code><\/p>\n<p>Can you please address the issue in the source code and release a fix?<\/p>\n<p>Thank you<\/p>\n","protected":false},"template":"","class_list":["post-1172430","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Hard Dependency on Local Storage Breaks Page in iOS Private Browsing -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/hard-dependency-on-local-storage-breaks-page-in-ios-private-browsing\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hard Dependency on Local Storage Breaks Page in iOS Private Browsing -\" \/>\n<meta property=\"og:description\" content=\"Hello, It looks like the filterbar has a hard dependency on local storage insofar as it fails to check if local storage is available before attempting to use it. It has the following conditional: tribe_storage&amp;&amp;tribe_storage.setItem(&quot;tribe_events_filters_wrapper&quot;,&quot;closed&quot;) iOS private browsing mode disables local storage. When the filterbar is used on iOS in private browsing mode, the script [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/hard-dependency-on-local-storage-breaks-page-in-ios-private-browsing\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-10-05T22:46:52+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/hard-dependency-on-local-storage-breaks-page-in-ios-private-browsing\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/hard-dependency-on-local-storage-breaks-page-in-ios-private-browsing\/\",\"name\":\"Hard Dependency on Local Storage Breaks Page in iOS Private Browsing -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-10-04T18:57:02+00:00\",\"dateModified\":\"2016-10-05T22:46:52+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/hard-dependency-on-local-storage-breaks-page-in-ios-private-browsing\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/hard-dependency-on-local-storage-breaks-page-in-ios-private-browsing\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/hard-dependency-on-local-storage-breaks-page-in-ios-private-browsing\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Filter Bar\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/filter-bar\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Hard Dependency on Local Storage Breaks Page in iOS Private Browsing\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Hard Dependency on Local Storage Breaks Page in iOS Private Browsing -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/hard-dependency-on-local-storage-breaks-page-in-ios-private-browsing\/","og_locale":"en_US","og_type":"article","og_title":"Hard Dependency on Local Storage Breaks Page in iOS Private Browsing -","og_description":"Hello, It looks like the filterbar has a hard dependency on local storage insofar as it fails to check if local storage is available before attempting to use it. It has the following conditional: tribe_storage&amp;&amp;tribe_storage.setItem(\"tribe_events_filters_wrapper\",\"closed\") iOS private browsing mode disables local storage. When the filterbar is used on iOS in private browsing mode, the script [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/hard-dependency-on-local-storage-breaks-page-in-ios-private-browsing\/","article_modified_time":"2016-10-05T22:46:52+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/hard-dependency-on-local-storage-breaks-page-in-ios-private-browsing\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/hard-dependency-on-local-storage-breaks-page-in-ios-private-browsing\/","name":"Hard Dependency on Local Storage Breaks Page in iOS Private Browsing -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-10-04T18:57:02+00:00","dateModified":"2016-10-05T22:46:52+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/hard-dependency-on-local-storage-breaks-page-in-ios-private-browsing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/hard-dependency-on-local-storage-breaks-page-in-ios-private-browsing\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/hard-dependency-on-local-storage-breaks-page-in-ios-private-browsing\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Filter Bar","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/filter-bar\/"},{"@type":"ListItem","position":5,"name":"Hard Dependency on Local Storage Breaks Page in iOS Private Browsing"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1172430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1172430\/revisions"}],"predecessor-version":[{"id":1172982,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1172430\/revisions\/1172982"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1172430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}