Skip to content

Commit

Permalink
MV3: Really support CSL import from all .csl github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
adomasven committed May 24, 2024
1 parent 783dda1 commit fe12c39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/browserExt/contentTypeHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Zotero.ContentTypeHandler = {
]),
mv3CSLWhitelistRegexp: {
"https://www.zotero.org/styles/\\1": /https?:\/\/(?:www\.)zotero\.org\/styles\/?#importConfirm=(.*)$/,
"https://raw.githubusercontent.com/\\1/styles/\\2": /https?:\/\/github\.com\/([^/]*)\/styles\/[^/]*\/([^.]*.csl)#importConfirm$/,
"https://raw.githubusercontent.com/\\1/\\2": /https?:\/\/github\.com\/([^/]*\/[^/]*)\/[^/]*\/([^.]*.csl)#importConfirm$/,
},
ignoreURL: new Set(),

Expand Down
4 changes: 2 additions & 2 deletions src/browserExt/styleInterceptRules.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
"action": {
"type": "redirect",
"redirect": {
"regexSubstitution": "https://github.com/\\1/styles/blob/\\2#importConfirm"
"regexSubstitution": "https://github.com/\\1/blob/\\2#importConfirm"
}
},
"condition": {
"regexFilter": "^https://raw\\.githubusercontent\\.com/([^/]*)/styles/([^/]*/[^#?]+.csl)$",
"regexFilter": "^https://raw\\.githubusercontent\\.com/([^/]*/[^/]*)/([^/]*/[^#?]+.csl)$",
"resourceTypes": ["main_frame"]
}
}
Expand Down

0 comments on commit fe12c39

Please sign in to comment.