Index: stats.js |
=================================================================== |
--- a/stats.js |
+++ b/stats.js |
@@ -29,17 +29,17 @@ |
facebook: ["https://www.facebook.com/dialog/feed", { |
app_id: "475542399197328", |
link: shareURL, |
redirect_uri: "https://www.facebook.com/", |
ref: "adcounter", |
name: messageMark, |
actions: JSON.stringify([ |
{ |
- name: chrome.i18n.getMessage("stats_share_download"), |
+ name: browser.i18n.getMessage("stats_share_download"), |
link: shareURL |
} |
]) |
}], |
gplus: ["https://plus.google.com/share", { |
url: shareURL |
}], |
twitter: ["https://twitter.com/intent/tweet", { |
@@ -54,17 +54,17 @@ |
let url = shareLinks[network][0]; |
let params = shareLinks[network][1]; |
let querystring = []; |
for (let key in params) |
{ |
let value = params[key]; |
if (value == messageMark) |
- value = chrome.i18n.getMessage("stats_share_message", blockedCount); |
+ value = browser.i18n.getMessage("stats_share_message", blockedCount); |
querystring.push( |
encodeURIComponent(key) + "=" + encodeURIComponent(value) |
); |
} |
return url + "?" + querystring.join("&"); |
} |
function onLoad() |
@@ -77,29 +77,29 @@ |
showIconNumber.setAttribute("aria-checked", showStatsInIcon); |
}); |
showIconNumber.addEventListener("click", toggleIconNumber, false); |
document.querySelector("label[for='show-iconnumber']").addEventListener( |
"click", toggleIconNumber, false |
); |
// Update stats |
- chrome.tabs.query({active: true, lastFocusedWindow: true}, tabs => |
+ browser.tabs.query({active: true, lastFocusedWindow: true}, tabs => |
{ |
currentTab = tabs[0]; |
updateStats(); |
document.getElementById("stats-container").removeAttribute("hidden"); |
}); |
} |
function updateStats() |
{ |
let statsPage = document.getElementById("stats-page"); |
- chrome.runtime.sendMessage({ |
+ browser.runtime.sendMessage({ |
type: "stats.getBlockedPerPage", |
tab: currentTab |
}, |
blockedPage => |
{ |
ext.i18n.setElementText(statsPage, "stats_label_page", |
[blockedPage.toLocaleString()]); |
}); |
@@ -118,21 +118,21 @@ |
{ |
// Easter Egg |
if (blockedTotal <= 9000 || blockedTotal >= 10000) |
{ |
blockedTotal = blockedTotal.toLocaleString(); |
} |
else |
{ |
- blockedTotal = chrome.i18n.getMessage("stats_over", |
- (9000).toLocaleString()); |
+ blockedTotal = browser.i18n.getMessage("stats_over", |
+ (9000).toLocaleString()); |
} |
- chrome.tabs.create({ |
+ browser.tabs.create({ |
url: createShareLink(ev.target.dataset.social, blockedTotal) |
}); |
}); |
} |
function toggleIconNumber() |
{ |
togglePref("show_statsinicon", showStatsInIcon => |