Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
get-canonical-url
Advanced tools
🔗 Determines the current page's canonical URL and optionally normalizes it for consistency.
Determines the current page's canonical URL and optionally normalizes it via normalize-url for consistency.
npm install get-canonical-url
# or...
yarn add get-canonical-url
Or pull directly from unpkg in-browser:
<script src="https://unpkg.com/get-canonical-url/dist/get-canonical-url.min.js"></script>
<link rel="canonical">
<!doctype html>
<html>
<head>
<link rel="canonical" href="https://www.example.com/this/doesnt/exist.aspx?no=really&it=doesnt#gocheck">
</head>
</html>
import canonicalUrl from "get-canonical-url";
canonicalUrl();
//=> 'https://www.example.com/this/doesnt/exist.aspx?no=really&it=doesnt#gocheck'
canonicalUrl({
normalize: true,
normalizeOptions: {
stripProtocol: true,
stripWWW: true,
stripHash: true
}
})
//=> 'example.com/this/doesnt/exist.aspx?it=doesnt&no=really'
<link rel="canonical">
import canonicalUrl from "get-canonical-url";
canonicalUrl({
guess: true,
normalize: true
});
//=> Determined via the individual user's window.location.href or other similar browser hints. Normalizing is recommended.
Type: object
Type: boolean
Default: false
Clean-up and normalize the determined canonical URL.
Type: NormalizeOptions
Default:
{
stripWWW: false,
stripHash: true,
removeQueryParameters: true,
removeTrailingSlash: false
}
Options passed directly to normalize-url
.
Requires options.normalize = true
.
Type: boolean
Default: false
Make an educated guess using other clues if canonical isn't explicitly set in the page's <head>
.
MIT
FAQs
🔗 Determines the current page's canonical URL and optionally normalizes it for consistency.
We found that get-canonical-url demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.