There is a website and I created a chrome extension for this website, if user have log in the website, is there any solution to let user don’t need to log in the chrome extension again?
Anyone can help me?
There is a website and I created a chrome extension for this website, if
Share
First: in your background page, add an iframe with a src=”yoursitesurl”. Then embed that iframe into body of the background page. The document may not have a “body”, so you may need to create that also. Then you can add the iframe to the body. the iframe will not load until you add it to the body, from my experience.
Second: add the following to your manifest.json:
Then create the “content.js” file. It will be loaded into you website in the iframe. In the content.js you will write JavaScript that will harvest the data from your site that you need. Then you will pass it back to the background page.
Third: pass it back to the background page. To pass the data from your content_script to the background page, do the following:
In the onMessage listener in the background page, you can do anything you want with the data from your site. You can save it to localStorage. You could alert it to the user. You could pass it to the popup.html. I am not sure what you want to do once you have the data, so this is where I stop, as I am not sure what you want to do next.