You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I understand the codes correctly, the new TextareaCache saves text-cache objects by a unique key `${sessionKey} ${url} ${id}`, so that newer contents of the same textarea simply overwrite older contents.
That's a good feature, but I'm afraid that there're exceptions.
Bilibili seems to be implementing a new UI design that re-use the same textarea element for different replies.
For example, if a userA and a userB have left their comments for a video, then I can see a "reply" button on each of their comments. By clicking the "reply" of userA, a textarea element shows up. After I write my comment and click "send", the textarea element disappears (becomes hidden). Then I click the "reply" of userB, the textarea element shows up again, with the text I wrote the last time. I'll have to clear it to write my comment for userB and click "send". As a result, TextareaCache only keeps the last piece of text.
To fix this (at least temporarily), I hope there'll be an option to switch back to the logic before - check all textarea and save all modifications of their contents.
(If that's too much, there's a better logic - overwrite older contents of the same textarea if and only if the older string is included in the newer string, otherwise save the newer content as well as the older one)
Required:
System OS: win10
Firefox version: firefox 133.0.3
Textarea Cache version: 4.10.2
The text was updated successfully, but these errors were encountered:
I, too, don't have a perfect solution.
Maybe, renew the cache-id when the content string is found to be empty (strip(save_info.val).length == 0) while there once was something (ta_database.get(`${tcl.sessionKey} ${location.href} ${event.target.dataset['tcId']}`) !== undefined).
Now that the saveToStorage method is called upon 'keyup' events, the cleanning-up-textarea-like changes should be able to be captured as expected.
I just hope people remember to delete their textarea contents before writing new comments on websites like Bilibili. Maybe add a remark in the addon's description string.
As for the side-effects (unwanted cases) on other websites, I guess it would be minor...
If I understand the codes correctly, the new TextareaCache saves text-cache objects by a unique key
`${sessionKey} ${url} ${id}`
, so that newer contents of the same textarea simply overwrite older contents.That's a good feature, but I'm afraid that there're exceptions.
Bilibili seems to be implementing a new UI design that re-use the same textarea element for different replies.
For example, if a userA and a userB have left their comments for a video, then I can see a "reply" button on each of their comments. By clicking the "reply" of userA, a textarea element shows up. After I write my comment and click "send", the textarea element disappears (becomes hidden). Then I click the "reply" of userB, the textarea element shows up again, with the text I wrote the last time. I'll have to clear it to write my comment for userB and click "send". As a result, TextareaCache only keeps the last piece of text.
To fix this (at least temporarily), I hope there'll be an option to switch back to the logic before - check all textarea and save all modifications of their contents.
(If that's too much, there's a better logic - overwrite older contents of the same textarea if and only if the older string is included in the newer string, otherwise save the newer content as well as the older one)
Required:
The text was updated successfully, but these errors were encountered: