Add website's pixel count tracker
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// Creating artificial API between two worlds
|
||||
|
||||
const log = console.log;
|
||||
console.log = (...args: any) => {
|
||||
const firstArg = args[0];
|
||||
if (firstArg && typeof firstArg === "object" && "pixelsPlaced" in firstArg) {
|
||||
const pixelsPlaced = new CustomEvent("__pixelsPlaced", {
|
||||
detail: firstArg.pixelsPlaced,
|
||||
});
|
||||
document.dispatchEvent(pixelsPlaced);
|
||||
}
|
||||
log(...args);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user