Reputation:
I have a chrome extension that I have running only on a certain domain using "matches":[] in my manifest.json. However, because I need the "webNavigation" permission to run the listener script below, users are told that my extension is able to read their browsing history upon installing. I don't think this is the case, because of the aforementioned "matches."
Below is the listener script I use to run my extension's code when they get on a certain page.
chrome.webNavigation.onHistoryStateUpdated.addListener(function(details) {
chrome.tabs.executeScript(null,{file:"content.js"});
});
Is there a way to do this without telling the user that the extension is listening to all browsing history?
Upvotes: 0
Views: 378
Reputation: 3467
Try this
chrome.webNavigation.onHistoryStateUpdated.addListener(function(details) {
chrome.tabs.executeScript(null,{file:"content.js"});
} ,{
url: {
hostContains: 'foo.com'
}
});
Upvotes: 0