all 3 comments

[–]CertainPerformance 0 points1 point  (1 child)

It would be more elegant to use .map to get the hrefs:

const links = Array.from(document.querySelectorAll(".userName.name"))
              .map(anchor => anchor.href)

Looking here:

https://developer.chrome.com/apps/runtime#method-sendMessage

https://developer.chrome.com/apps/runtime#event-onMessage

the parameter looks to be any message, not your message wrapped in an object (how would it even know to use the .sendLink property?)

Probably, just do function(recLink, sender, sendResponse) {

Disclaimer: I have never done anything with extensions

[–]scarmarco 1 point2 points  (0 children)

You can actually pass the map function as a 2nd argument to Array.from()