Another IE surprise

We all know that the usage of InternetExplorer brings a lot of problems for us (the developers). Did you know that there is a JavaScript method createStyleSheet that you can call only 31 times.

There is a nice file manager called CKEditor. It worked fine, but today it produced the following javascript error in IE:

Message: Not enough storage is available to complete this operation.

I googled the problem and found this thread. It perfectly explains the problem - the usage of createStyleSheet. The solution is not very elegant, but I think it solved the problem. I opened ckfinder.js and found the following code:

if(this.$.createStyleSheet)this.$.createStyleSheet(k)

Which means that the editor checks if this method is available and then uses it. So I edit the line to:

if(false)this.$.createStyleSheet(k)

Of course the best option is to reduce the number of the css files that are loaded in the page.

If you enjoy this post, share it on Twitter, Facebook or LinkedIn.

With over two decades of deep front-end expertise, I offer comprehensive web consultancy and stack audits, alongside specialized workshops, training, and engaging public speaking to elevate your team's skills and optimize your digital presence. Contact me.