Need to run content script even after a page refresh.

1,022 views
Skip to first unread message

Kartik Jadeja

unread,
Apr 2, 2016, 5:34:26 AM4/2/16
to Chromium-Extensions-Announce
I am trying to develop a chrome extension where in a popup.html page will be loaded whenever I clicked on the icon in the address bar.
Popup.html has set of text area tool and a submit button at the end.
The value that user gives in this popup.html page is then send to content page. Content page also contains similar types of text area wherein this value is set.
Now I wrote a javascript code in this content.js page, that after values given by user is set a click events are performed.
The first button is successfully clicked by my javascript code which result into refresh of the content page and hence my code for second button click using javascript doesnt work.
Please help me with this.
I want to continue executing javascript on my content page even after content page gets refresh.

PhistucK

unread,
Apr 2, 2016, 6:18:27 AM4/2/16
to Kartik Jadeja, Chromium-Extensions-Announce
Then you have to listen to chrome.tabs.onUpdated and use chrome.tabs.executeScript (or send a message to your content script, if you have one defined) once that tab has finished loading, I would guess.


PhistucK

--
You received this message because you are subscribed to the Google Groups "Chromium-Extensions-Announce" 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 https://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/c8772b5a-3376-466e-a487-f5a35bf173f1%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Reply all
Reply to author
Forward
0 new messages