quill.setContents freezes in Firefox

Created on 14 Feb 2018  路  7Comments  路  Source: quilljs/quill

When using quill.setContents(...) in Firefox the editor content is never updated and the browser warns that the script is slowing it.

Steps for Reproduction

  1. Visit the playground
  2. Open the web console and select the iframe containing the editor
  3. Paste the following code :
    quill.setContents([ { insert: 'Hello ' }, { insert: 'World!', attributes: { bold: true } }, { insert: '\n' } ]);

Expected behavior:

The editor content should be updated with the given Delta.

Actual behavior:

The editor content is never updated and the page is frozen.

Platforms:

  • Firefox 58.0.2
  • macOS 10.13.3

Version:

1.3.5

needs reproduction

Most helpful comment

Thought I would also comment since this is an old thread but still happening in 1.3.6.

I have been trying to step through some code in the Firefox console and found that when running in a console, with all extension disabled (version 75.0 on Mac) that the code will never run and show the yellow bar that a script has stopped responding.

new Quill('#testing', {
theme: 'snow'
});

This only happens in Firefox and not Chrome. I though I was going crazy till I tried to execute the code without the console. Seems like the console is doing something that prevents this from working as expected. I can work around the issue but really annoying.

All 7 comments

It seems to be working for me on the same OS + browser. Can you try disabling all your browser extensions?

I tried disabling my extension (I only have uBlock Origin) or using a new profile (using -ProfileManager).
Unfortunately I still have the same issue.

Stopping the script produces the following stacktraces :

Error: Script terminated by timeout at: optimize@https://cdn.quilljs.com/1.3.5/quill.js:7092:1 LinkedList</LinkedList.prototype.forEach@https://cdn.quilljs.com/1.3.5/quill.js:6963:13 ScrollBlot</ScrollBlot.prototype.optimize@https://cdn.quilljs.com/1.3.5/quill.js:7130:13 optimize@https://cdn.quilljs.com/1.3.5/quill.js:4307:7 ScrollBlot</ScrollBlot.prototype.update@https://cdn.quilljs.com/1.3.5/quill.js:7171:9 update@https://cdn.quilljs.com/1.3.5/quill.js:4331:7 ScrollBlot/_this.observer<@https://cdn.quilljs.com/1.3.5/quill.js:7033:13 ShadowBlot</ShadowBlot.prototype.insertInto@https://cdn.quilljs.com/1.3.5/quill.js:5060:13 ContainerBlot</ContainerBlot.prototype.insertBefore@https://cdn.quilljs.com/1.3.5/quill.js:3418:9 insertBefore@https://cdn.quilljs.com/1.3.5/quill.js:4264:7 ContainerBlot</ContainerBlot.prototype.appendChild@https://cdn.quilljs.com/1.3.5/quill.js:3324:9 ContainerBlot</ContainerBlot.prototype.optimize@https://cdn.quilljs.com/1.3.5/quill.js:3435:17 ScrollBlot</ScrollBlot.prototype.optimize@https://cdn.quilljs.com/1.3.5/quill.js:7066:9 optimize@https://cdn.quilljs.com/1.3.5/quill.js:4307:7 deleteAt@https://cdn.quilljs.com/1.3.5/quill.js:4219:7 deleteText@https://cdn.quilljs.com/1.3.5/quill.js:2506:7 setContents/<@https://cdn.quilljs.com/1.3.5/quill.js:1458:23 modify@https://cdn.quilljs.com/1.3.5/quill.js:1610:16 setContents@https://cdn.quilljs.com/1.3.5/quill.js:1455:14 @debugger eval code:1:1 quill.js:7092:1

Error: Script terminated by timeout at: LinkedList</LinkedList.prototype.forEachAt@https://cdn.quilljs.com/1.3.5/quill.js:6971:17 getLines@https://cdn.quilljs.com/1.3.5/quill.js:4288:9 lines@https://cdn.quilljs.com/1.3.5/quill.js:4298:14 getDelta@https://cdn.quilljs.com/1.3.5/quill.js:2556:14 update@https://cdn.quilljs.com/1.3.5/quill.js:2683:22 deleteText@https://cdn.quilljs.com/1.3.5/quill.js:2507:14 setContents/<@https://cdn.quilljs.com/1.3.5/quill.js:1458:23 modify@https://cdn.quilljs.com/1.3.5/quill.js:1610:16 setContents@https://cdn.quilljs.com/1.3.5/quill.js:1455:14 @debugger eval code:1:1 quill.js:6971:17

I could reproduce this on

Ubuntu 16.04, Firefox 58.0.2 (64-bit)
Quill 1.3.5. (the one that is currently used on the playground)

The tab freezes and after some time, I get the yellow "A page is slowing down your browser" warning.

(I did not setup a new profile though deactivated adblocker and the like)

Hello, this is a problem of Firefox.
It happens when ShadowBlot is trying to reorder content with ContainerBlot.
It calls 10 000x InsertInto from ShadowBlot. Chrome it handles good but the Firefox is not ready for this.

It's take a 174 seconds to perform setContents. (The delta has 10 598 ops).
We are trying to find a workaround for this.

Quill 1.3.6, Firefox 61.0.1 (64-bit)

I've faced the same issue myself, we are now entering the 2020, the question is not settled yet. T.T

Still an issue, 2 years later. Doesn't even work with the example given at https://quilljs.com/docs/api/#setcontents

Firefox v73.0, Windows 10.

Thought I would also comment since this is an old thread but still happening in 1.3.6.

I have been trying to step through some code in the Firefox console and found that when running in a console, with all extension disabled (version 75.0 on Mac) that the code will never run and show the yellow bar that a script has stopped responding.

new Quill('#testing', {
theme: 'snow'
});

This only happens in Firefox and not Chrome. I though I was going crazy till I tried to execute the code without the console. Seems like the console is doing something that prevents this from working as expected. I can work around the issue but really annoying.

Was this page helpful?
0 / 5 - 0 ratings