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

Weird Safari #271

Closed
neville9763 opened this issue Nov 26, 2016 · 4 comments
Closed

Weird Safari #271

neville9763 opened this issue Nov 26, 2016 · 4 comments
Assignees
Labels
Milestone

Comments

@neville9763
Copy link

neville9763 commented Nov 26, 2016

Hi

I am using the shim and Dexie (https://github.com/dfahlander/Dexie.js) and having an issue with mobile Safari (ios 9.3.5), and have implemented the following code as suggested (on Dexie site):

	//add db shim for ios
	if(/(iPhone|iPod|iPad)/i.test(navigator.userAgent)) { 

		// Force shim
		//window.shimIndexedDB.__debug(true);
		window.shimIndexedDB.__useShim();
		
		Dexie.dependencies.indexedDB = window.shimIndexedDB;
		Dexie.dependencies.IDBKeyRange = window.shimIndexedDB.modules.IDBKeyRange;
				
	} else {
		
	    // Force native
	    Dexie.dependencies.indexedDB = indexedDB;
	    Dexie.dependencies.IDBKeyRange = IDBKeyRange;
		
	}

When forcing use of the shim (using __useShim), the object shimIndexedDB is created as expected but shimIndexedDB.modules.IDBKeyRange remains undefined (also window.shimIndexedDB.modules.IDBKeyRange and self.shimIndexedDB.modules.IDBKeyRange are also undefined).

On other platforms, no issues.

Anybody have any suggestions about how I can try and resolve this or where I can find IDBKeyRange?

Thanks

Neville

@brettz9 brettz9 added this to the 3.0.0 milestone Jan 20, 2017
@brettz9 brettz9 self-assigned this Jan 20, 2017
@brettz9 brettz9 changed the title Wierd Safari Weird Safari Feb 15, 2017
@pesimeao
Copy link

Any update on this?

@brettz9
Copy link
Collaborator

brettz9 commented Feb 16, 2017

I am working as I can on getting IndexedDBShim to pass a number of tests in its core functionality before testing browser specific bugs for an anticipated 3.0.0 release. You are welcome to try the code in master and see how it meets your needs as well as update the issue or submit a PR.

IDBKeyRange is defined in src/IDBKeyRange.js. If you experiment with the code, you will need to run the build steps and include the relevant updated file in dist. We'd love to have more concrete information on exactly how and why it is failing in Safari, but I don't expect having time to look at it more closely for some time as I work through some other bugs while testing on the more stable platforms of Node and Chrome.

@brettz9
Copy link
Collaborator

brettz9 commented Apr 16, 2017

Ok, in now finally being able to pay a little attention to browser-specific issues...

In master, the standard IDB modules are no longer being set on window.shimIndexedDB.modules. Just look on window.IDBKeyRange once __useShim() has been called.

I will close as that should answer your question, but feel free and comment further or reopen if there is something else.

@brettz9 brettz9 closed this as completed Apr 16, 2017
@brettz9
Copy link
Collaborator

brettz9 commented Apr 16, 2017

Btw, you may want to watch #277 (to which I intend to add a comment shortly) as it is of concern for iOS9 (and non-Chrome Android).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Browser bugs
Safari/iOS
Development

No branches or pull requests

3 participants