github-url-detection
Advanced tools
Comparing version 4.4.0 to 4.5.0
@@ -39,2 +39,7 @@ "use strict"; | ||
const isMilestone = (url = location) => { | ||
var _a; | ||
return /^milestone\/\d+/.test(null === (_a = getRepo(url)) || void 0 === _a ? void 0 : _a.path); | ||
}; | ||
const isNewIssue = (url = location) => { | ||
@@ -140,3 +145,6 @@ var _a; | ||
const canonical = document.querySelector('[property="og:url"]'); | ||
url = canonical ? canonical.content : location; | ||
if (canonical) { | ||
const canonicalUrl = new URL(canonical.content, location.origin); | ||
getCleanPathname(canonicalUrl).toLowerCase() === getCleanPathname(location).toLowerCase() && (url = canonicalUrl); | ||
} | ||
} | ||
@@ -209,3 +217,3 @@ "string" == typeof url && (url = new URL(url, location.origin)); | ||
exports.isConversationList = (url = location) => isGlobalConversationList(url) || isRepoConversationList(url); | ||
exports.isConversationList = (url = location) => isGlobalConversationList(url) || isRepoConversationList(url) || isMilestone(url); | ||
@@ -252,6 +260,3 @@ exports.isDashboard = isDashboard; | ||
exports.isMilestone = (url = location) => { | ||
var _a; | ||
return /^milestone\/\d+/.test(null === (_a = getRepo(url)) || void 0 === _a ? void 0 : _a.path); | ||
}; | ||
exports.isMilestone = isMilestone; | ||
@@ -258,0 +263,0 @@ exports.isMilestoneList = (url = location) => { |
@@ -43,3 +43,3 @@ var reservedNames = [ "400", "401", "402", "403", "404", "405", "406", "407", "408", "409", "410", "411", "412", "413", "414", "415", "416", "417", "418", "419", "420", "421", "422", "423", "424", "425", "426", "427", "428", "429", "430", "431", "500", "501", "502", "503", "504", "505", "506", "507", "508", "509", "510", "511", "about", "access", "account", "admin", "anonymous", "any", "api", "apps", "attributes", "auth", "billing", "blob", "blog", "bounty", "branches", "business", "businesses", "c", "cache", "case-studies", "categories", "central", "certification", "changelog", "cla", "cloud", "codereview", "collection", "collections", "comments", "commit", "commits", "community", "companies", "compare", "contact", "contributing", "cookbook", "coupons", "customer-stories", "customer", "customers", "dashboard", "dashboards", "design", "develop", "developer", "diff", "discover", "discussions", "docs", "downloads", "downtime", "editor", "editors", "edu", "enterprise", "events", "explore", "featured", "features", "files", "fixtures", "forked", "garage", "ghost", "gist", "gists", "graphs", "guide", "guides", "help", "help-wanted", "home", "hooks", "hosting", "hovercards", "identity", "images", "inbox", "individual", "info", "integration", "interfaces", "introduction", "invalid-email-address", "investors", "issues", "jobs", "join", "journal", "journals", "lab", "labs", "languages", "launch", "layouts", "learn", "legal", "library", "linux", "listings", "lists", "login", "logos", "logout", "mac", "maintenance", "malware", "man", "marketplace", "mention", "mentioned", "mentioning", "mentions", "migrating", "milestones", "mine", "mirrors", "mobile", "navigation", "network", "new", "news", "none", "nonprofit", "nonprofits", "notices", "notifications", "oauth", "offer", "open-source", "organisations", "organizations", "orgs", "pages", "partners", "payments", "personal", "plans", "plugins", "popular", "popularity", "posts", "press", "pricing", "professional", "projects", "pulls", "raw", "readme", "recommendations", "redeem", "releases", "render", "reply", "repositories", "resources", "restore", "revert", "save-net-neutrality", "saved", "scraping", "search", "security", "services", "sessions", "settings", "shareholders", "shop", "showcases", "signin", "signup", "site", "spam", "sponsors", "ssh", "staff", "starred", "stars", "static", "status", "statuses", "storage", "store", "stories", "styleguide", "subscriptions", "suggest", "suggestion", "suggestions", "support", "suspended", "talks", "teach", "teacher", "teachers", "teaching", "team", "teams", "ten", "terms", "timeline", "topic", "topics", "tos", "tour", "train", "training", "translations", "tree", "trending", "updates", "username", "users", "visualization", "w", "watching", "wiki", "windows", "works-with", "www0", "www1", "www2", "www3", "www4", "www5", "www6", "www7", "www8", "www9" ]; | ||
const isConversationList = (url = location) => isGlobalConversationList(url) || isRepoConversationList(url); | ||
const isConversationList = (url = location) => isGlobalConversationList(url) || isRepoConversationList(url) || isMilestone(url); | ||
@@ -280,3 +280,6 @@ const isConversation = (url = location) => isIssue(url) || isPRConversation(url); | ||
const canonical = document.querySelector('[property="og:url"]'); | ||
url = canonical ? canonical.content : location; | ||
if (canonical) { | ||
const canonicalUrl = new URL(canonical.content, location.origin); | ||
getCleanPathname(canonicalUrl).toLowerCase() === getCleanPathname(location).toLowerCase() && (url = canonicalUrl); | ||
} | ||
} | ||
@@ -283,0 +286,0 @@ "string" == typeof url && (url = new URL(url, location.origin)); |
{ | ||
"name": "github-url-detection", | ||
"version": "4.4.0", | ||
"version": "4.5.0", | ||
"description": "Which GitHub page are you on? Is it an issue? Is it a list? Perfect for your WebExtension or userscript.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
54036
709