Skip to content

Instantly share code, notes, and snippets.

@neatshell
Last active March 4, 2020 20:23
Show Gist options
  • Save neatshell/edecf727ace7b5b49518a8c371879687 to your computer and use it in GitHub Desktop.
Save neatshell/edecf727ace7b5b49518a8c371879687 to your computer and use it in GitHub Desktop.
document.querySelector* cheatsheet
// Get the canonical url of a page
document.querySelector("link[rel='canonical']").href;
document.querySelector("link[rel='canonical']").getAttribute("href");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment