I’m building a browser action chrome extension where I’m filling in a login page. After I submit the form I am taken to a 2nd page. How can I continue execution of my script on the new page to fill in the next form that appears?
You'll need to send any relevant state to your extension's background page so that when the content script is executed on the next page it can read back the data and pick up where the last page left off.
I’m building a browser action chrome extension where I’m filling in a login page. After I submit the form I am taken to a 2nd page. How can I continue execution of my script on the new page to fill in the next form that appears?
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/5ace3806-ef5d-4bc4-b67b-c0fdfeeb3643%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.
No, there must be two separate scripts. The content script is injected into the page, the background page is part of the extension and always runs in the background while the extension is loaded. You can use postMessage to send messages between them. Only the content script can modify the form on the page.
Thanks. So in theory my background.js could fill in the first form, submit the page, store a value to say page 1 processingn done, then when page 2 loads, the same background.js will be loaded. Which means I can then read that page 1 is done and then continue processing page 2?
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/277f6f67-1d06-41c2-b552-45e9e8e9a2ec%40chromium.org.