Linkedin extension to avoid auto scroll for messages area

Code sample:

javascript:{ var messageBar = $('.msg-conversations-container__conversations-list.list-style-none.ember-view'); var prevSctollPos = messageBar.scrollTop(); function onScrollMessage(){ prevSctollPos = messageBar.scrollTop() <= 0 ? prevSctollPos : messageBar.scrollTop(); } messageBar.scroll(onScrollMessage); $("textarea[name='message'").keydown(function (e) { if (e.which == 13) { messageBar.scrollTop(prevSctollPos); var tmp = prevSctollPos; setTimeout(function () { messageBar.scrollTop(tmp) }, 300); } }); alert('applied');}