wildskyf / TextareaCache

Browser Add-on: Automatically save the content in Textarea.
MIT License
66 stars 7 forks source link

Submitted data aren't saved? #30

Closed lilydjwg closed 6 years ago

lilydjwg commented 7 years ago

I lost my data. It took me a long time to write. I submitted to the site but it wasn't saved. I assumed that the site sucked again and wanted to retry. But I couldn't find my text in this web extensions version of textarea cache.

I see no reason for textarea cache to not save submitted data, because some websites suck, and extensions are there to rescue. At least, this extension is here to fix websites that can't save valuable user input correctly.

wildskyf commented 7 years ago

Hi @lilydjwg,

Could you provide the website url you lost data? So that I could debug easier. :)

lilydjwg commented 7 years ago

No, unless you want to offer your phone number to a Chinese website and try to learn some Chinese. And it's not easily reproducible. I suspect that the server returned a 500 error to that Ajax data submission.

I prefer this extension works like the XUL one: no matter what, keep inputted text for some time, so even a site swallows the data (like to return a 200 page saying that there is an error), I can submit again.

wildskyf commented 7 years ago

@lilydjwg I am from Taiwan, so reading Chinese is not a problem to me. ;P

Get down to business, Textarea Cache Lite will overwrite data only when you type something new to THE textarea you just submitted. So if you didn't touch the textarea, your saved data should be safe, but you should make sure your text is saved first. Could you please help me to check whether your text could be saved?

lilydjwg commented 7 years ago

OK then. Try to post a long comment to a 知乎 answer and see if it'll get lost.

It's weird then. I have lots of text in that comment so Textarea Cache Lite should have time to save it. BTW it's not a textares.

There seem to be some bugs. I've done some tests, only paste/type, not submit.

So do you have a 知乎 account to test these cases?

wildskyf commented 6 years ago

嗨, @lilydjwg ,

想麻煩你確認一下,現在最新版本的 Textarea Cache 是否還會在送出後把 cache 覆蓋掉

lilydjwg commented 6 years ago

Hi,使用刚刚更新过的 Textarea Cache:

不会覆盖旧项目了。

PS: 更新过没重启。是有一些日子的 Firefox Nightly。这次测试,我是断开代理再提交的(所以提交了但是会失败)。

wildskyf commented 6 years ago

感謝幫測試 & 謝謝你的描述如此清晰。 :)

不会覆盖旧项目了。

是故意&預期內的行為,每次重開頁面就會開新的 cache 來存文字

reply to a comment via the popup: not saved

好,這也是個 bug,我有想到但還沒時間解,或許這個週末會來動手更新

我是断开代理再提交的

是指斷開 VPN 嗎?目前程式是在一開始會放 css class 到要看的 textarea 上 (和其他要看的元素上),之後看 css class 有沒有被 focus,所以 VPN 應該不會影響才是

讓提交後不會消失的方法是看他回給 background script 的資料移除 html tag 後的 length 是不是 0,是的話就忽略他不儲存

lilydjwg commented 6 years ago

不是 VPN,就是个本地 HTTP 代理,为了避免把测试文本提交出去就关掉了。

wildskyf commented 6 years ago

Hi @lilydjwg

就是個本地 HTTP 代理

了解,不過這應該不影響 add-on 的行為~

reply to a comment via the popup

方便請你協助我確認這個問題解決了嗎?

wildskyf commented 6 years ago

ping @lilydjwg

lilydjwg commented 6 years ago

在知乎弹出评论里回复时,还是什么都没保存到。

PS: 改成弹出窗口了呀,不过那个窗口怎么在失去焦点的时候就关掉了呢(我更喜欢在新标签页打开,然后别跑)。另外在 summary 里显示 HTML 代码了,<div class="… 这样子显示没什么用啊。

wildskyf commented 6 years ago

奇怪了,那我再看一下要怎麼解這個問題好了…

我有在思考在新標籤頁打開的可能性,或許會加個 option 讓你可以選擇要哪個

summary 是簡單地顯示裡面的東西而已,主要還是要按 show 才知道完整的資訊,我會再試試把裡面的自顯示得多一點會不會有什麼問題

wildskyf commented 6 years ago

ref: #52

lilydjwg commented 6 years ago

知乎那个回复框是动态生成的,大概跟这个有关?

加 option 好麻烦的。主要是这个弹窗我一不小心焦点移出去它就自己关掉了。

你可以在 summary 里把 HTML 标签去掉只留文字。

wildskyf commented 6 years ago

我現在有每兩秒就看一下有沒有新的 textContent 生成,所以就算是動態生成的應該也抓得到才是,除非我犯了某個 reference 的錯誤(等等去 check) ref: https://github.com/wildskyf/TextareaCache/blob/master/content-script.js#L34-L36

因為使用者各有偏愛,所以我還是會做成選項

預設是彈出 tab 頁 但也能改成彈出 window,(跟以前的 textarea cache 一樣) auto-close 變成可選的選項,預設是不勾選

summary 那個這麼做似乎比較好,我會開個 issue,一樣在下一個版本會更新上去,感謝你的意見!

wildskyf commented 6 years ago

v3.7.0 應該就會動了,剛剛才發現我之前寫的 Code 莫名消失了(不然就是我以為我有寫XD)

wildskyf commented 6 years ago

@lilydjwg v3.8.0 上線了,再麻煩你試試看!

lilydjwg commented 6 years ago

可以了,谢谢! 👍