Merge branch 'gothub_gist' of https://github.com/NoPlagiarism/browser_extension into NoPlagiarism-gothub_gist
This commit is contained in:
commit
605e385b2e
@ -487,14 +487,7 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
case "gothub": {
|
case "gothub": {
|
||||||
const regex = /^\/(.*)\/(.*)\/(?:blob|tree)\/(.*)\/(.*)/.exec(url.pathname)
|
if (url.hostname == "gist.github.com") return `${randomInstance}/gist${url.pathname}${url.search}`
|
||||||
if (regex) {
|
|
||||||
const user = regex[1]
|
|
||||||
const repo = regex[2]
|
|
||||||
const branch = regex[3]
|
|
||||||
const path = regex[4]
|
|
||||||
return `${randomInstance}/file/${user}/${repo}/${branch}/${path}`
|
|
||||||
}
|
|
||||||
return `${randomInstance}${url.pathname}${url.search}`
|
return `${randomInstance}${url.pathname}${url.search}`
|
||||||
}
|
}
|
||||||
case "mikuInvidious": {
|
case "mikuInvidious": {
|
||||||
|
@ -703,7 +703,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"targets": [
|
"targets": [
|
||||||
"^https?:\\/{2}github\\.com\\/"
|
"^https?:\\/{2}github\\.com\\/",
|
||||||
|
"^https?:\\/{2}gist.github\\.com\\/[^\\/]+\\/[^\\/]+\\/?"
|
||||||
],
|
],
|
||||||
"name": "GitHub",
|
"name": "GitHub",
|
||||||
"options": {
|
"options": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user