Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Track the number of copied shots in Telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhirsch committed Nov 20, 2017
1 parent 49ac607 commit 336f147
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addon/bootstrap.js
Expand Up @@ -234,6 +234,9 @@ function handleMessage(msg, sender, sendReply) {
} else if (msg.funcName === "incrementUploadCount") {
Services.telemetry.scalarAdd('screenshots.upload', 1);
sendReply({type: "success", value: true});
} else if (msg.funcName === "incrementCopyCount") {
Services.telemetry.scalarAdd('screenshots.copy', 1);
sendReply({type: "success", value: true});
}
}

Expand Down
1 change: 1 addition & 0 deletions addon/webextension/background/main.js
Expand Up @@ -209,6 +209,7 @@ this.main = (function() {
return blobConverters.blobToArray(blob).then(buffer => {
return browser.clipboard.setImageData(
buffer, blob.type.split("/", 2)[1]).then(() => {
catcher.watchPromise(communication.sendToBootstrap('incrementCopyCount'));
return browser.notifications.create({
type: "basic",
iconUrl: "../icons/copy.png",
Expand Down

0 comments on commit 336f147

Please sign in to comment.