Advertisement
Guest User

Untitled

a guest
May 18th, 2017
1,632
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. function detectPrivateMode(n) {
  2. var e;
  3. if (window.webkitRequestFileSystem) window.webkitRequestFileSystem(window.TEMPORARY, 1, function () {
  4. e = !1
  5. }, function (n) {
  6. e = !0
  7. });
  8. else if (window.indexedDB && /Firefox/.test(window.navigator.userAgent)) {
  9. var i;
  10. try {
  11. i = window.indexedDB.open('test')
  12. } catch (n) {
  13. e = !0
  14. }
  15. void 0 === e && t(function () {
  16. return 'done' === i.readyState
  17. }, function (n) {
  18. n || (e = !i.result)
  19. })
  20. } else if (o(window.navigator.userAgent)) {
  21. e = !1;
  22. try {
  23. window.indexedDB || (e = !0)
  24. } catch (n) {
  25. e = !0
  26. }
  27. } else if (window.localStorage && /Safari/.test(window.navigator.userAgent)) {
  28. if (window.safariIncognito) e = !0;
  29. else try {
  30. window.localStorage.setItem('test', 1)
  31. } catch (n) {
  32. e = !0
  33. }
  34. void 0 === e && (e = !1, window.localStorage.removeItem('test'))
  35. }
  36. t(function () {
  37. return void 0 !== e
  38. }, function (t) {
  39. n(e)
  40. })
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement