ie plugin to give alert on click of message send button of Ms Teams not working

  • Thread starter Thread starter Pushpanjay Umrao
  • Start date Start date
P

Pushpanjay Umrao

Guest
I have create a IE pluginthat shows an alert on clicking the send button of Ms Teams and Facebook messenger. I have used jquery for click event. However the click event is not getting registered. so nothing happens when i click the send button. Below is my code. i used different events of page life cycle to get it to work but none of them did. below is my code.

console.log("This is a test");
debugger;

$(document).ready(function() {
console.log( "ready!" );
// for ms teams send button
$('#send-message-button').click(function(){
debugger;
alert("clicked");
});
//for fb messenger send button
$("a[aria-label=Send]").click(function(){
debugger;
alert("test");
});
});
$('#send-message-button').bind("click", function(){
alert("The paragraph was clicked.");
});
$(window).bind(function () {
$('#send-message-button').click(function(){

alert("clicked");
});
$("a[aria-label=Send]").click(function(){
debugger;
alert("test");
});
});
$(window).on('load', function() {
// code here
$('#send-message-button').click(function(){

alert("clicked");
});
});


Console.log works when i refresh the page. however the click event doesnt get registered to the button. so i am assuming that my click event tries to get registered before the complete page is loaded. Is there any way i can register the event after the whole page is loaded. or is there any other way to achieve my goal to show alert when send button is clicked.

Note: this is my first chrome extension

Continue reading...
 
Back
Top