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

FontLoader localStorage #28

Open
onedrop opened this issue Jul 31, 2017 · 6 comments
Open

FontLoader localStorage #28

onedrop opened this issue Jul 31, 2017 · 6 comments

Comments

@onedrop
Copy link

onedrop commented Jul 31, 2017

FontLoader checks for localStorage like so... if(localStorage). This doesn't handle the case where the browser does in fact support localStorage but its been disabled via browser configuration/preferences. In this circumstance, an access is denied error will be thrown by the browser when attempting to access localStorage.

I noticed a TODO for this in the code already but was hoping you could address this and release a new version of the library. Using a function like this to check for localStorage availability will resolve the issue...

function hasLocalStorage(){
	var item = 'check'
	try {
		localStorage.setItem(item, item);
		localStorage.removeItem(item);
		return true;
	} catch(e) {
		return false;
	}	
}

Thanks!

@diverted247
Copy link
Owner

Nice catch. Will add and release within the week.

@slahav
Copy link

slahav commented Aug 30, 2017

Any update on this?

@diverted247
Copy link
Owner

No progress yet. If you wanted to do a pull request it would speed things. I want to make sure what is added is essential vs something that can be done externally.

onedrop added a commit to onedrop/txtjs that referenced this issue Sep 7, 2017
@onedrop
Copy link
Author

onedrop commented Sep 7, 2017

Added a PR for this... #29

@slahav
Copy link

slahav commented Oct 12, 2017

@diverted247 can you please review #29

@mmoss
Copy link

mmoss commented Oct 27, 2017

It would be great if we could get some traction on #29

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

4 participants