79689702

Date: 2025-07-04 05:37:43
Score: 0.5
Natty:
Report link

After reading some of the comments/solutions, here's a solution that suppose to work using one A tag.
Thanks @Jasper & @will

function generateLinker(){
  var tag_id = 'gtm_linker_generator';
  var cross_domain = "https://domain-b.com";

  var e = document.getElementById(tag_id);
  // create link element
  if (!e){
    var a = document.createElement('A');
    a.id = tag_id;
    a.style.display = 'none';
    a.href = cross_domain ;
    document.body.append(a);
    e = a;
  }
  e.dispatchEvent(new MouseEvent('mousedown', {bubbles: true }))
  return e.href;
}
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Yoray