Advertisement
RichTatum

Get Canonical URL

Jan 16th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. javascript:var u; try { u=document.querySelector("link[rel=canonical]").href; } catch (e) {} if(u){ if(prompt("Canonical URL: - Press OK to navigate",document.title+'\n'+window.location.href+'\n'+'Canonical: '+u)) { window.location=u; } else { /* unobtainium */ u=null; } } else { prompt("No canonical URL found. Displaying current URL:", document.title+'\n'+window.location.href+'\n'+'Canonical: '+'none'); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement