-1

i need to use XMLHttpRequest in order to communicate with a Chrome extension from my web page with javascript.

$("#sendMessageToExt").click(function(){
                var xhttp = new XMLHttpRequest();
                    xhttp.open("POST", "http://127.0.0.1:31666/", true);
                    var data = "Message Received";
                    xhttp.send(data);
                });

is it possible to have the server side (a very simple server for only receive and send shor messages) with javascript?

what i want is to communicate with my chrome extension.

PeterPam
  • 337
  • 6
  • 20
  • You cannot perform server side tasks with vanilla javascript. In order to perform that you would have to use NodeJS for javascript or other server side languages. You can try out a tutorial here: https://code.tutsplus.com/tutorials/learning-server-side-javascript-with-nodejs--net-10044 – Dblaze47 Apr 19 '19 at 07:37
  • You have several options, the one we personnally use works fine: [NodeJs](https://stackoverflow.com/questions/5998694/how-to-create-an-https-server-in-node-js) – Kaddath Apr 19 '19 at 07:38
  • "Chrome extension from my web page" ? I dont understand this part. – Nikola Lukic Apr 19 '19 at 07:38

1 Answers1

0

the best solution is using

https://github.com/jcubic/sysend.js/

communicate windows is easy

PeterPam
  • 337
  • 6
  • 20