With Redirects, Browser send the referral value of domain where the link was clicked. To avoid the passage of referrer value, i am using No-referrer
tag.
PHP
header("Referrer-Policy: no-referrer");
header("Location: https://example.com", true, 301);
Javascript :
document.referrer = "no-referrer";
window.opener = null;
window.location.replace("https://example.com");
//window.location.href = "https://example.com";
//window.location.replace("https://example.com", "_blank", "noopener,noreferrer");
HTML
<meta name="referrer" content="no-referrer">
<meta name="referrer" content="no-opener">
<meta http-equiv="refresh" content="0; url=https://example.com">
jQuery
$(document).ready(function() {
//window.location.replace("https://www.google.com");
window.location = "https://www.google.com";
document.referrer = "no-referrer";
});
Which one will do fastest redirect with empty referrer value?
Via Active questions tagged javascript - Stack Overflow https://ift.tt/rxjRPaZ
Comments
Post a Comment