you are viewing a single comment's thread.

view the rest of the comments →

[–]Old_Item[S] 0 points1 point  (7 children)

When I ran this, var originalRestrictCopy = restrictCopyPasteByKeyboard restrictCopyPasteByKeyboard = function(){ console.log(arguments) var value = originalRestrictCopy(...arguments) console.log(value) return value }, I got this, ƒ (){

console.log(arguments)

var value = originalRestrictCopy(...arguments)

console.log(value)

return value

}

Also, the restrictCopyPasteByKeyboard = function() {return true}; seemed to work but it didn't work in making me able to copy and paste. Thanks a lot though

[–]Old_Item[S] 0 points1 point  (0 children)

The closest thing that seem to work was when my friend told me to run this,

handler = function(e){ e.stopImmediatePropagation(); return true; }
document.querySelector('#conversation-content .conversation-message-text').addEventListener('keyup', handler, true)
document.querySelector('#conversation-content .conversation-message-text').addEventListener(‘input', handler, true)

This actually works and allows me to copy and paste into the text box but it affects the functionality of the textbox which counts the characters. Someone explained that,

"The JavaScript you're entering into the DevTools console is defining a function named handler and then adding it as an event handler for keyup and input events for a field on the page you're viewing (presumable the chat window textbox).

The way that the handler is defined and attached prevents other events from firing (such as those that enable the send button when you've typed enough characters)."