blob: 39d2579535eb790b976f6fb81a95b5853588eaf0 [file] [log] [blame]
var websites = {"badware": "http://www.google.com/safebrowsing/report_badware/?url=", "webspam": "https://www.google.com/webmasters/tools/spamreportform?spamurl=", "phishing": "http://www.google.com/safebrowsing/report_phish/?url="};
var options = document.querySelectorAll("div#options div.option");
for (var i = 0; i < options.length; i++) {
options[i].innerText = chrome.i18n.getMessage("report_"+options[i].id);
options[i].onclick = function(a) {
var id = this.id;
chrome.tabs.query({
lastFocusedWindow: true,
active: true
}, function(tab){
chrome.tabs.create({
url: websites[id]+encodeURI(tab[0].url),
index: tab[0].index + 1
});
});
}
}