1 year ago

#254752

test-img

smrpm

Prevent content-scripts from running for a chrome extension with login when user is not authorised

I am working on a chrome extension that will extract keywords from a particular website(x) and search for those keywords in another website's(y) search page. I am using iframes to load the search page(of y) and it will be added as a modal/div to the first page(x) ,this funcationality is added in content-scripts of chrome extension. But I want to make sure the website x is logged in and chrome extension has to be authenticated by SSO based on website X's login. Can anyone help me to prevent the content-script from injecting div to the website x if website y is not authenticated in extensi. Find the code below that is used in content-script to inject the div

$("body").append("<div id = \"slider\" style=\"position: fixed;top: 0px;right: 0px;z-index: 9999;\"><div id=\"iframe\" style=\"position: fixed;top: 0px;right: 0px;z-index: 9999;\"><iframe style=\"border:1px solid #868686;-webkit-box-shadow: 2px 2px 20px 1px rgba(0, 0, 0, 0.5);\" src=\" https:abc.com/search \" width=580 HEIGHT=740></iframe></div><button id=\"button\">PushMe!</button></div>");```

javascript

google-chrome-extension

content-script

0 Answers

Your Answer

Accepted video resources