I’d like to have my background page watch the URL and call chrome.tabs.executeScript on certain URLs. What API should I call to watch the URL in such a manner?
I’d like to have my background page watch the URL and call chrome.tabs.executeScript on
Share
chrome.tabs.onUpdated.addListenercan be used to detect tab loads. This will not detect navigation within frames though:For this purpose, you’d better use a content script, with
all_framesset to true. Within the content script, you can inject code using the methods as described in this answer. Then use the page’slocationobject to filter URLs.