How do I highlight email address strings through a chrome extension?

18 views Asked by At

I am currently making a chrome extension that looks for all the email addresses on a webpage and then highlights them to make them more visible. I was following a video that guided me on the script that searches for the emails but am not sure how to actually highlight them.

This is the code I have so far, but like I mentioned previously, I'm not quite sure how to proceed with it.

function scrapeEmailsFromPage() {
    
    const emailRegEx = /[\w\.=-]+@[\w\.-]+\.[\w]{2,3}/gim;

    
    let emails = document.body.innerHTML.match (emailRegEx);
}```
0

There are 0 answers