Skip to content

Instantly share code, notes, and snippets.

@jarno-vos
Last active January 16, 2024 08:51
Show Gist options
  • Save jarno-vos/bbc749948d80b8fd2edbd245ff864d00 to your computer and use it in GitHub Desktop.
Save jarno-vos/bbc749948d80b8fd2edbd245ff864d00 to your computer and use it in GitHub Desktop.
adsterra-example-modification.js
// Get the script URL by decoding the base64 string
var decodedUrl = atob("PHNjcmlwdCB0eXBlPSd0ZXh0L2phdmFzY3JpcHQnIHNyYz0nLy9vdmVybG9hZG1hdHVyZXNwYW5uZXIuY29tLzE3L2JjLzZjLzE3YmM2YzFjMjkyOWM3ZDYxZjAzMmVkNTI1MjcyNWExLmpzJz48L3NjcmlwdD4=");
// Create a new script element
var script = document.createElement('script');
script.type = 'text/javascript';
script.async = true;
// Get the 'src' value from the decoded string
var parser = new DOMParser();
var doc = parser.parseFromString(decodedUrl, 'text/html');
var src = doc.querySelector('script').src;
// Set the script source to the decoded URL
script.src = src;
// Append the script to the document
document.body.appendChild(script);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment