Nick1, я так понял ты вообще не знаешь js?
var comment = (function createCurrentURLComment(window){
function punycodeDecodeURI(href) {
const at = href.indexOf('@') + 1 || href.indexOf('://') + 3 || href.indexOf(':') + 1;
const sl = href.indexOf('/', at) + 1 || href.length;
return href.slice(0, at)
+ href.slice(at, sl).replace(
/(^|\.)xn--(?:([a-z0-9-]+)-)?([a-z0-9]+)/g,
function(text, separator, ascii, utf) {
const output = Array.from(ascii || '', c => c.charCodeAt(0));
const input = Array.from(utf, c => c.charCodeAt(0) - (c < ':' ? 0x16 : 0x61));
const inputLength = input.length;
for (let x = 0, i = 0, j = 0, n = 128, b = 72, o = output.length + 1; x < inputLength; j = i) {
for (let w = 1, k = 36, d, t;; k += 36) {
if (x === inputLength) return text; //invalid-input
d = input[x++];
if (d > ((2147483647 - i) / w | 0)) return text; //overflow
i += d * w;
t = k <= b ? 1 : k >= b + 26 ? 26 : k - b;
if (d < t) break;
if (w > (2147483647 / (t = 36 - t) | 0)) return text; //overflow
w *= t;
}
b = j === 0 ? i / 700 | 0 : i - j >> 1;
b += b / o | 0;
for(j = 0; b > 455; j += 36) b = b / 35 | 0;
b = j + 36 * b / (b + 38) | 0;
if ((j = i / o | 0) > 2147483647 - n) return text; //overflow
n += j;
i %= o++;
output.splice(i++, 0, n);
}
return separator + String.fromCodePoint(...output);
}
)
+ href.slice(sl)
}
function getSavedFrom(){
return ' saved from url=' + decodeURI(punycodeDecodeURI(location.href)) + ' ';
}
var document = window.document,
location = window.location,
comment = document.createComment(getSavedFrom());
document.documentElement.before(comment);
window.addEventListener('popstate', function(){
comment.data = getSavedFrom();
}, false);
return comment
}(window));