benweet / stackedit.js

Add StackEdit to any website
https://benweet.github.io/stackedit.js/
MIT License
1.08k stars 118 forks source link

Instantly closes, or opens blank iframe #16

Open abartov opened 6 years ago

abartov commented 6 years ago

Hello. First of all, many thanks for StackEdit! It's a wonderful piece of work!

I've been trying to embed it in a project, but after opening correctly the first few times, it stopped working, now either opening correctly but instantly closing (no error on the console), or opening with a blank window.

I've switched to a simple HTML file (served from my app, to avoid the file:// protocol), matching the example code, which again, worked for a bit and then stopped working.

Can you offer thoughts on what might be the problem?

Here is my test file (renamed to .html.txt for uploading here) --

stackedit_test.html.txt

abartov commented 6 years ago

screenshot from 2018-08-19 16-13-00

abartov commented 6 years ago

Update: it now works fine in Chrome 68, but still instantly closes (after briefly flashing the StackEdit logo) on Firefox 62. Does that suggest a direction, @benweet ?

abartov commented 6 years ago

Using "private mode" in Firefox 62, the SlackEdit logo hangs and the editor buffers never show. The console shows:

"Error: Can't connect to IndexedDB. localDbSvc.js:28:12 t/r.onerror localDbSvc.js:28:12"

UPDATE: oh, never mind, I understand it's a limitation of Firefox's private mode, as described in Stackedit's Issue #1302.

But the instantly-closing behavior is still happening, on non-private Firefox 62 on Ubuntu 18.04.

tlindbloom commented 6 years ago

If it helps anyone - I see the same instantly close behavior on Firefox 60.1.0esr (64-bit) with RHEL, but the frame properly stays open on 60.2.0esr (32-bit) on Windows 10.

Both were done using the buttons on the stackedit-js example page

cristichiru commented 5 years ago

Just clear the cache and should work, not sure what is the reason for this, as I have seen it too.

pohadkar commented 5 years ago

got the same behavior in FF 62.0.3 (64 bit) iframe keeps immediately closing after some 2 hours of using in my project. only thing that help is going to stackedit.io/app and click on reset application. so it is probably some application cache. is there any way to avoid this? in chrome its working good all the time.

update: i have found the main problem. when i open file for editing on my site, 4 new rows are added to indexed db (for domain stackedit.io). so, when i edit this file like 12 times, there is about 50 lines in indexed db, and iframe with editor stops working. (probably because it cant put more rows to indexed db). when i delete all rows in indexed db for stackedit.io, iframe editor works again. i think, it shouldnt add new rows, when you start edit file, but update old rows, or delete previous. mr. benweet, are you going to do something with this? or is there any setting in openFile, which i missed?

another solution would be, to delete indexed db, on close event.

killua-eu commented 5 years ago

same as @pohadkar with FF 62.0.3 64bit, both on Win and Linux. At first I didn't encounter the problem, but after loading a dev project today again, exactly as described. 12 edits kill stackedit.

abartov commented 5 years ago

Thank you, @pohadkar! This seems to be the problem indeed. Can anyone come up with a patch?

shaunbruno commented 4 years ago

Experiencing this on Safari 13.0.5

Puyodead1 commented 4 years ago

Experiencing on Chrome 81, just installed onto website