Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari Private Browsing #134

Closed
danielschuetter opened this issue Sep 9, 2015 · 7 comments
Closed

Safari Private Browsing #134

danielschuetter opened this issue Sep 9, 2015 · 7 comments

Comments

@danielschuetter
Copy link

When running Safari (both Desktop and iOS) in private mode the 'req' in Line 506 is null which results in a Type Error. (TypeError: Attempted to assign to readonly property.)

Could you please handle this error more gracefully like the error in Line 505?

https://github.com/dfahlander/Dexie.js/blob/master/dist/latest/Dexie.js#L505-L507

dfahlander added a commit that referenced this issue Sep 22, 2015
@dfahlander
Copy link
Collaborator

Thanks!

@VityaSchel
Copy link

This issue is still present in Tor Browser, is there any way to polyfill window.indexeddb?

@binwiederhier
Copy link

It seems to happen on Firefox mobile in private mode as well. Maybe the APIs are simply not available. A poly fill would be great.

DatabaseClosedError: InvalidStateError A mutation operation was attempted on a database that did not allow mutations.
 InvalidStateError: A mutation operation was attempted on a database that did not allow mutations.
  at undefined (DatabaseClosedError: InvalidStateError A mutation operation was attempted on a database that did not allow mutations.:undefined:undefined)
  at undefined ( InvalidStateError: A mutation operation was attempted on a database that did not allow mutations.:undefined:undefined)
  at from (../node_modules/dexie/dist/modern/dexie.min.mjs:16613:1)
  at from (../node_modules/dexie/dist/modern/dexie.min.mjs:16801:1)
  at from (../node_modules/dexie/dist/modern/dexie.min.mjs:15440:1)
  at from (../node_modules/dexie/dist/modern/dexie.min.mjs:10172:1)
  at from (../node_modules/dexie/dist/modern/dexie.min.mjs:10929:1)
  at from (../node_modules/dexie/dist/modern/dexie.min.mjs:11290:1)

DatabaseClosedError: InvalidStateError A mutation operation was attempted on a database that did not allow mutations.
 InvalidStateError: A mutation operation was attempted on a database that did not allow mutations.
  at mh@https://ntfy.sh/static/js/main.1114899f.js:2:763256
  at mp@https://ntfy.sh/static/js/main.1114899f.js:2:714684
  at n@https://ntfy.sh/static/js/main.1114899f.js:2:757824
  at C@https://ntfy.sh/static/js/main.1114899f.js:2:344757
  at Z@https://ntfy.sh/static/js/main.1114899f.js:2:344482
  at E@https://ntfy.sh/static/js/main.1114899f.js:2:344867
  at pp@https://ntfy.sh/static/js/main.1114899f.js:2:713944
  at th@https://ntfy.sh/static/js/main.1114899f.js:2:754496
  at gh

@punithbm
Copy link

@dfahlander does dexi is supported in the private window firefox ?

@dfahlander
Copy link
Collaborator

@dfahlander does dexi is supported in the private window firefox ?

Unfortunately Firefox is the only browser that blocks IndexedDB in private mode instead of providing a temporary db like chrome and safari does it.

@punithbm
Copy link

Ah..Thanks for the quick response
Do you know of any alternate methods to handle this

@dfahlander
Copy link
Collaborator

Where your app catches errors (such as an ErrorBoundrary in React, or similary), display a friendly message that application could not be started.

Specificall, Firefox throws InvalidStateError in private mode.

https://jsitor.com/dMq2lGvOqz

const db = new Dexie("x");
db.version(1).stores({
  foo: 'bar'
});

db.open().then(()=>{
  console.log("Database successfully opened");
}).catch(err => {
  if (err.name === 'InvalidStateError') {
    console.log("Firefox private mode node supported.")
  } else {
    console.log(err);
  }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants