🎉 New Features & Improvements
-
Event Handling Refactor: Refactored the keyboard event handling mechanism. Now
Enter
,Ctrl+Enter
, andShift+Enter
are properly handled for line break insertion and message sending. This improves interaction withcontenteditable
elements and input fields. -
Enhanced DOM Traversal: Improved the logic for locating send and edit buttons. The traversal is now more reliable and scalable, preventing errors in complex DOM hierarchies. More accurate button detection based on selectors has been added.
-
Logging & Debugging: Introduced a flexible logging system to track key script behaviors. This helps to quickly identify and fix issues, as well as to understand the logic during debugging.
🛠️ Bug Fixes
-
Fixed Line Break Insertion: Resolved the issue with line break insertion in
contenteditable
elements and text fields. Now line breaks are inserted correctly upon pressingEnter
orShift+Enter
, avoiding event loops and conflicts. -
Corrected Message Send Simulation: Fixed bugs related to simulating the message send button click on
Ctrl+Enter
. The updated button-finding logic ensures successful message sending. -
Event Conflict Prevention: Implemented safeguards against event conflicts during keypress simulations. The function now accounts for all possible key combinations and prevents cyclic behavior.
🔧 Under the Hood
-
Improved Code Structure: The code has been cleaned up and made more maintainable. Key functions have been rewritten and documented for better readability and to reduce technical debt.
-
Better Performance: Optimized DOM element traversal processes, reducing browser load and improving script performance.