Created
September 6, 2024 15:55
-
-
Save dbongo/5e6ec612af252f6d563275338e8b7c8b to your computer and use it in GitHub Desktop.
Canonical Link Helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function(){ var canonicalLink = document.querySelector('link[rel="canonical"]'); var message; if (canonicalLink) { message = 'Canonical link found: ' + canonicalLink.href; var dummy = document.createElement('textarea'); document.body.appendChild(dummy); dummy.value = canonicalLink.href; dummy.select(); document.execCommand('copy'); document.body.removeChild(dummy); } else { message = 'No canonical link found.'; var dummy = document.createElement('textarea'); document.body.appendChild(dummy); dummy.value = message; dummy.select(); document.execCommand('copy'); document.body.removeChild(dummy); } alert(message);})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment