title: Override JS function of website from injected script from extension
body: <p>Hello folks I'm trying to develop an extension for my chrome browser to add emoticons to the chat of a website that i usually visit, so on that page yo need to pay 25 box if you want to purchase an emoticon for me its very expensive so I decided to create a extension to inject some emotes, the problem is I can't override his functions to insert my own emotes I have tried several times and didn't work I share you the original script and my injected script if someone can orient me I 'll be very helpfully, I have ruduced original script bucause it have hundreds of emotes so I just leave a few as reference.</p>
  
  <p>Original Script:</p>
  
  <pre><code>function clsEmoticons() {
      this.Insert = Insert;
      this.Handle = Handle;
  
      function Insert(obj, txt) {
          var cursorPos = $('#' + obj).prop('selectionStart');
          var v = $('#' + obj).val();
          var textBefore = v.substring(0, cursorPos);
          var textAfter = v.substring(cursorPos, v.length);
          $('#' + obj).val(textBefore + txt + textAfter);
      }
  
      function Handle(v1, response, the_channel, isGuest) {
          if (the_channel != "e") {
              try {
                  the_channel = ChatV2.appChannel;
                  the_channel = the_channel.toLowerCase();
              } catch (e) {}
          }
          response = response.replaceAll3(":)", "&lt;img class=\"chat_img smile\" src=\"https://cdn.website.com/img/clear.png\" border=\"0\" /&gt; ");
          if (!isGuest) {
  
              response = response.replaceAll3("(WCV)", "&lt;img class=\"chat_img vsemoji_WCV_000\" src=\"https://cdn.website.com/img/clear.png\" border=\"0\" /&gt;");
          }
          if (the_channel == "test") {
              response = response.replaceAll3("bounce", "&lt;img class=\"chat_img bounce\" src=\"https://cdn.website.com/img/clear.png\" border=\"0\" /&gt;");
          }
          return response;
      }
  }
  var ChatEmoticons = new clsEmoticons();
  </code></pre>
  
  <p>Injected script:</p>
  
  <p><a href="https://pastebin.com/w2KtXAG7" rel="nofollow noreferrer">https://pastebin.com/w2KtXAG7</a></p>