javascript - How do I detect that all frames have returned responses from a contentscript in a Chrome extension? -
i want chrome extension rerun contentscript open tabs prior viewing popup window gather recent data each webpage (it sends message background page). problem in order full access each iframe, need set allframes true. means prior showing popup window, need wait until have received message each frame.
my problem not sure how determine how many frames there are. 1 approach looked @ detect frame count within contentscript, there open bug indicates can't request right now. wait number of responses equivalent got when first navigated page, possible due ajax calls number of frames increased since then. finally, hoping response chrome.extension.sendrequest include such information not.
your appreciated.
i suggest run content script manifest, content script run every time new frame loads. then, have content script open port extension, every open frame has port background. it's background page keep track of open ports each tab, , send messages desired ports.
Comments
Post a Comment