alerzo,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script>
document.addEventListener("DOMContentLoaded", function() {
let searchString = 'https://site.com/promo.php?banner=152539';
let source = document.body.innerHTML;
const escapeRegExp = str => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
let reg = new RegExp(`['"]${escapeRegExp(searchString)}['"]`, 'mig');
if (source.search(reg) !== -1) {
alert('Ссылка найдена');
} else {
alert('Ссылка не найдена');
}
})
</script>
</head>
<body>
<a href="https://site.com/promo.php?banner=152539" title="test">test</a>
</body>
</html>