guardian / scribe

DEPRECATED: A rich text editor framework for the web platform
http://guardian.github.io/scribe/
Apache License 2.0
3.51k stars 245 forks source link

Firefox: NS_ERROR_FAILURE when refreshing page #435

Open jamespamplin opened 8 years ago

jamespamplin commented 8 years ago

A page with Scribe and scribe-plugin-toolbar will throw a NS_ERROR_FAILURE error when the scribe element is focussed and the page is refreshed on Firefox.

NS_ERROR_FAILURE:
 at CommandPatch.prototype.queryState@http://guardian.github.io/scribe/bower_components/scribe/scribe.js:6655:14
 at updateUi@http://guardian.github.io/scribe/bower_components/scribe-plugin-toolbar/scribe-plugin-toolbar.js:49:34
NS_ERROR_FAILURE:
 at Command.prototype.queryState@http://guardian.github.io/scribe/bower_components/scribe/scribe.js:6691:16
 at updateUi@http://guardian.github.io/scribe/bower_components/scribe-plugin-toolbar/scribe-plugin-toolbar.js:49:34

Appears to be caused by document.queryCommandState throwing the error for each toolbar element when the page is refreshed.

rrees commented 8 years ago

@jamespamplin yeah there are a number of Firefox focus issues. Do you think there is way of detecting and correcting the focus in code?

jamespamplin commented 8 years ago

I caught NS_ERROR_UNEXPECTED errors with a try catch in #406 before. Was thinking of wrapping document.queryCommandState in a try catch for this specific error.