0

I want to pass a value through URL of iframe to my node server from my chrome extension. I want to get the src on server

var webAppURL = "http://127.0.0.1:3000";

var iframe = document.getElementById("token"); // creating iframe and define id

        iframe = document.createElement('iframe');
        iframe.id = "token";
        iframe.src = webAppURL ;
        document.body.appendChild(iframe);
Rahul Baby
  • 159
  • 2
  • 2
  • 7
  • Perhaps you could use `var webAppURL = "http://127.0.0.1:3000?data=yourData"`. Does it help: https://stackoverflow.com/questions/17863986/is-there-a-way-to-pass-javascript-variables-in-url – teg_brightly May 16 '20 at 12:54
  • And in the server file you could read it like: `app.get('/', function(req, res) { let data = req.query.data; ...` – teg_brightly May 16 '20 at 13:07

0 Answers0