Skip to content

Instantly share code, notes, and snippets.

// change the TARGET variable to "chatgpt", "atlas" etc. and paste to console
// you'll see that you see nothing
(() => {
const TARGET = "atlas";
const results = [];
const seen = new WeakSet();
// Suppress noisy unhandled promise rejections during the scan
const unrHandler = (e) => { e.preventDefault && e.preventDefault(); };
window.addEventListener('unhandledrejection', unrHandler);
@justusbluemer
justusbluemer / shodow-dom-clicktracking
Created September 18, 2025 10:23
Shadow DOM Clicktracking
document.addEventListener('click', function(e) {
let text = '';
const MAX_TRAVERSAL_DEPTH = 10; // Prevent infinite traversal
const visited = new Set(); // Prevent cycles
// First, try standard text extraction on the clicked element
text = e.target.innerText || e.target.textContent || e.target.value || '';
// If no meaningful text, check common data attributes on clicked element
if (!text || text.trim() === '') {
@justusbluemer
justusbluemer / tcf.js
Created May 7, 2025 12:50
Get active TCF data overview
// Execute in browser's JS console
(function () {
/* 1. Is a TCF CMP present? */
if (typeof window.__tcfapi !== 'function') {
console.warn('⚠️ No __tcfapi on this page – either no CMP, it is still booting, or the site only exposes GPP (__gpp).');
return;
}
/* 2. Ping the CMP for basic status ...................................... */
@justusbluemer
justusbluemer / gtagGeolocation.js
Last active March 14, 2024 12:52
gtagGeolocation
async function gtagGeolocation() {
try {
// Fetch the script from the specified URL
const response = await fetch('https://www.googletagmanager.com/gtag/js?id=G-CRGJ6H77X9&l=dataLayer&cx=c');
const text = await response.text();
// Use regex to extract the Base64 string
const regex = /=JSON\.parse\(zb\("(.+?)"\)\)/;
const matches = regex.exec(text);
@justusbluemer
justusbluemer / gtm-snippet-with-fallback.html
Created January 30, 2023 11:38
Google Tag Manager gtm.js 1st party snippet with www.googletagmanager.com fallback
<!-- Google Tag Manager -->
<script>
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != "dataLayer" ? "&l=" + l : "";
j.async = true;
j.onerror = function () {
const log = function() {
console.log("This was tracked to GA:")
console.log(arguments);
// … perhaps doing something else with this
}
google_tag_manager.mb.listen(log)
@justusbluemer
justusbluemer / adcell.js
Created February 2, 2021 15:51
ADCELL conversion tracking code
<script type="text/javascript" src="http://www.adcell.de/js/jsadlib.js"></script>
<script type="text/javascript">
Adcell.user.track({
'pid' : '0000',
'eventid' : '0000',
'referenz' : 'ABC_123',
'betrag' : '123.45'
});
</script>
function() {
var setCookie = function (cookieName, cookieValue, expirationInMinutes, domain) {
var expirationTime = expirationInMinutes * 60 * 1000;
var date = new Date();
var dateTimeNow = date.getTime();
date.setTime(dateTimeNow + expirationTime);
var expirationTime = date.toUTCString();
document.cookie = cookieName+"="+cookieValue+"; expires="+expirationTime+"; path=/; domain="+domain;
@justusbluemer
justusbluemer / loadJSONFiles.js
Created December 2, 2019 15:53
Loads files from a directory and parses them as JSON
const fs = require("fs")
;(async function() {
let items = await loadJSONFiles("items/")
console.log(items)
})()
/**
* Loads and parses JSON files from the specified directory
* @param {string} dirname The name of the directory
@justusbluemer
justusbluemer / couchdb-reset-password-macos.md
Last active July 16, 2019 08:18
How to reset the CouchDB admin password on macOS

If you want to reset the admin password of your CouchDB database, you just have to edit your configuration file at

/Users/{username}/Library/Preferences/couchdb2-local.ini

and remove the lines immediately after "[admins]". Then, restart CouchDB. Please make sure to create a new admin user for security.

Thanks to Alex Burghardt for his hint at apache/couchdb#1020 (comment)