Skip to content

Commit

Permalink
Merge pull request #46 from htadashi/master
Browse files Browse the repository at this point in the history
feat: add link to alphaXiv in extra services menu
  • Loading branch information
j3soon authored Aug 4, 2024
2 parents 44a3f05 + a63d56d commit dac9d22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions chrome/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ function addCustomLinksAsync(id) {
<h3>Extra Services</h3> \
<ul> \
<li><a href="https://ar5iv.labs.arxiv.org/html/${id}">ar5iv (HTML 5)</a></li> \
<li><a href="https://alphaxiv.org/abs/${id}">alphaXiv</a></li> \
<li><a href="https://export.arxiv.org/api/query/id_list/${id}">RSS feed</a></li> \
</ul>`;
elExtraRefCite.after(extraServicesDiv);
Expand All @@ -124,10 +125,10 @@ async function enableDirectDownload(id, articleInfo) {
// Ref: https://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words
// Ref: https://stackoverflow.com/a/42210346
.replace(/[/\\?*:|"<>]/g, '_'); // Replace invalid characters.
;
;
const directURL = `https://arxiv.org/pdf/${id}.pdf`;
const downloadA = document.getElementById(DIRECT_DOWNLOAD_A_ID)
downloadA.addEventListener('click', function(e) {
downloadA.addEventListener('click', function (e) {
chrome.runtime.sendMessage({
url: directURL,
filename: fileName,
Expand Down
5 changes: 3 additions & 2 deletions firefox/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ function addCustomLinksAsync(id) {
<h3>Extra Services</h3> \
<ul> \
<li><a href="https://ar5iv.labs.arxiv.org/html/${id}">ar5iv (HTML 5)</a></li> \
<li><a href="https://alphaxiv.org/abs/${id}">alphaXiv</a></li> \
<li><a href="https://export.arxiv.org/api/query/id_list/${id}">RSS feed</a></li> \
</ul>`;
elExtraRefCite.after(extraServicesDiv);
Expand All @@ -124,10 +125,10 @@ async function enableDirectDownload(id, articleInfo) {
// Ref: https://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words
// Ref: https://stackoverflow.com/a/42210346
.replace(/[/\\?*:|"<>]/g, '_'); // Replace invalid characters.
;
;
const directURL = `https://arxiv.org/pdf/${id}.pdf`;
const downloadA = document.getElementById(DIRECT_DOWNLOAD_A_ID)
downloadA.addEventListener('click', function(e) {
downloadA.addEventListener('click', function (e) {
browser.runtime.sendMessage({
url: directURL,
filename: fileName,
Expand Down

0 comments on commit dac9d22

Please sign in to comment.