my code:-
// ==UserScript==
// @name Instagram Direct :sob: to 😭
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Replaces :sob: with 😭 in Instagram Direct message textbox
// @author Your Name
// @match https://www.instagram.com/direct/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Watch for keypress events on the document object
document.addEventListener('keydown', function(event) {
// Check if the keypress was triggered in an input element
if (event.target.tagName === 'INPUT' || event.target.tagName === 'TEXTAREA') {
const messageInput = event.target;
// Replace :sob: with 😭
messageInput.value = messageInput.value.replace(/:sob:/g, '😭');
}
});
})();
when i type :sob: it doesnt do anything but when i type :sob:/" it gives 😭/
can someone pointout the error