BUG iOS safari navigation bug (fixes #8039)

This commit is contained in:
Kirk Mayo 2012-11-30 15:32:03 +13:00 committed by Ingo Schommer
parent 700c95a523
commit 20a5bc1d36

View File

@ -504,7 +504,22 @@ jQuery.noConflict();
if($(el).data('ignoreTabState')) return; // allow opt-out if($(el).data('ignoreTabState')) return; // allow opt-out
activeTabs.push({id:id, active:$(el).tabs('option', 'active')}); activeTabs.push({id:id, active:$(el).tabs('option', 'active')});
}); });
if(activeTabs) window.sessionStorage.setItem('tabs-' + url, JSON.stringify(activeTabs));
if(activeTabs) {
var tabsUrl = 'tabs-' + url;
try {
window.sessionStorage.setItem(tabsUrl, JSON.stringify(activeTabs));
} catch(err) {
if (err.code === DOMException.QUOTA_EXCEEDED_ERR && window.sessionStorage.length === 0) {
// If this fails we ignore the error as the only issue is that it
// does not remember the tab state.
// This is a Safari bug which happens when private browsing is enabled.
return;
} else {
throw err;
}
}
}
}, },
/** /**