This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node | |
var topics = {} # Stores event subscribers { name, token, callback, unsubscribeOnExecute } | |
var published_topics = [] # Ordered list of published topics | |
var execution_counts = {} # Tracks how many times each topic's subscribers have run | |
var next_token = 1 # Auto-incrementing ID for subscription tokens | |
# Subscribe to an event with a unique token and optional auto-unsubscribe | |
func subscribe(topic: String, func_ref: Callable, options: Dictionary) -> String: | |
var run_if_already_published = options.get("runIfAlreadyPublished", false) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is outdated, for the up to date version see: | |
https://github.com/FikretHassan/report-ads-to-slack-chrome-extension/blob/main/Ad%20Feedback%20Toggle%20Extension/adtech.js | |
*/ | |
window.top.googletag.cmd.push(function() { | |
window.top.adentify = window.top.adentify || {}; | |
window.top.adentify.about = { // deatils about this version of the code | |
version: '0.1', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const observer = new ReportingObserver( | |
(reports, observer) => { | |
console.log('ADTECH: reporting observer results:', JSON.stringify(reports)); | |
}, { | |
buffered: true | |
} | |
); | |
// start watching for interventions | |
observer.observe(); |