Skip to content

Instantly share code, notes, and snippets.

@stepanger
Last active March 26, 2017 04:23
Show Gist options
  • Save stepanger/49419f534a495ef435120aef2e824dab to your computer and use it in GitHub Desktop.
Save stepanger/49419f534a495ef435120aef2e824dab to your computer and use it in GitHub Desktop.
var setting = [
/google/i,
/habrahabr/i,
/kinogo/i
];
var setting_lenght = setting.length - 1;
chrome.history.onVisited.addListener(function(results){
var URR = results.url;
for (var i = 0; i <= setting_lenght; i++) {
if(setting[i].test(URR)){
console.log("sendMesage.js ➤ TRUE ➤ " + URR);
chrome.history.deleteUrl({url: URR}, function(){
console.info("sendMesage.js ➤ DELETE TRUE ➤ ", URR);
});
}else{
console.log("sendMesage.js ➤ FALSE ➤ onMessage ➤" + URR);
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment