Meaningful titles for tabs and PDF downloads! Also supports tab search.

Overview

arxiv-utils

icon

If you are a researcher that reads a lot on ArXiv, you'll benefit a lot from this web extension.

  • Renames the title of PDF page to the paper's title.
  • Adds a button to navigate back to Abstract page.
  • Download PDF with paper's title as filename.
  • Works with Native Tab Search, and other plugins! (See the Solution Descriptions section for more details)
  • All required permissions are documented in detail.

Download Links

Supports Chrome, Firefox, Edge, Firefox on Android. (Android version is not tested)

Screenshots

The paper id in the title has been removed automatically! A direct download link is added to download PDF with paper's title as the filename! Finally... Meaningful paper title instead of paper id! (For Firefox, this is achieved through a custom PDF container.) Difficult to get back to abstract page... Click to get back to abstract page! TADA~ The abstract page is shown at the right of the PDF page! Both with meaningful title! The button is disabled if not in ArXiv's domain. Meaningful bookmark titles. Meaningful OneTab entries! (Chrome & Edge only) Opened too many tabs? Search in terms of the paper title! Works well with vertical tabs. Right-click the extension icon and select Options to set your preference. (Chrome & Edge) Go to add-ons page, click the extension select Options to set your preference. (Firefox)

Problem Description

ArXiv is a really nice website for researchers, but I think it has 3 main shortages:

  1. Unable to link to abstract page from PDF page if the PDF page is accessed directly.
  2. No meaningful title for the PDF page, the abstract page have a redundant paper id as the prefix of the title. Bookmarking the PDF page is useless for later bookmark searches.
  3. Downloading PDF requires a manual renaming afterwards.

This extension provides a solution to all of them!

Solution Descriptions

For ArXiv PDF / abstract tabs:

  • Renames the title to paper's title automatically in the background. (Originally is meaningless paper id, or start with paper id)
  • Add a browser button to open its corresponding abstract / PDF page. (Originally is hard to get back to abstract page from PDF page)
  • Add a direct download link on abstract page, click it to download the PDF with the title as filename. (Originally is paper id as filename)
  • Better title even for bookmarks and the OneTab plugin!
  • Firefox has strict restrictions on PDF.js. So it doesn't work well with OneTab, the PDF renaming is achieved by intercepting requests and show the PDF in a container. The bookmark works well though.
  • Works well with native tab search (credits: @The Rooler)

Chrome / Edge Documentation

Permissions

  • tabs: On button click, open a new tab and move it to the right of the old active tab.
  • activeTab: Read active tab's title and modify it using the tab's url.
  • storage: Save extension configurations.
  • *://export.arxiv.org/*: Query the title of the paper using the paper id retrieved in the tab's url.
  • *://arxiv.org/*: This plugin works on ArXiv's abstract and PDF page.

Methods

  • background (background.js)

    Mainly describes the methods for button click. (Open new tab)

    Compacted methods:

    // This background script is for adding the back to abstract button.
    var app = {};
    // All logs should start with this.
    app.name = "[arXiv-utils]";
    // Return the type parsed from the url. (Returns "PDF" or "Abstract")
    app.getType = function (url);
    // Return the id parsed from the url.
    app.getId = function (url, type);
    // Open the abstract / PDF page using the current URL.
    app.openAbstractTab = function (activeTabIdx, url, type);
    // Check if the URL is abstract or PDF page, returns true if the URL is either.
    app.checkURL = function (url);
    // Called when the url of a tab changes.
    app.updateBrowserActionState = function (tabId, changeInfo, tab);
    // Run this when the button clicked.
    app.run = function (tab) {
      if (!app.checkURL(tab.url)) {
        console.log(app.name, "Error: Not arXiv page.");
        return;
      }
      var type = app.getType(tab.url);
      app.openAbstractTab(tab.index, tab.url, type);
    }
    // Listen for any changes to the URL of any tab.
    chrome.tabs.onUpdated.addListener(app.updateBrowserActionState);
    // Extension button click to modify title.
    chrome.browserAction.onClicked.addListener(app.run);
  • content_scripts (content.js)

    Mainly describes what will be run when page loaded. (Modify tab title)

    Runs at document_end (The DOM has finished loading, but resources such as scripts and images may still be loading.) for urls: *://arxiv.org/*.pdf, *://arxiv.org/abs/*.

    Compacted methods:

    var app = {};
    // All logs should start with this.
    app.name = "[arXiv-utils]";
    // These 4 below are For checking if tab title has been updated.
    app.id = undefined;
    app.type = undefined;
    app.title = undefined;
    app.newTitle = undefined;
    // These 2 below are for inserting download link.
    app.firstAuthor = undefined;
    app.publishedYear = undefined;
    // Return the type parsed from the url. (Returns "PDF" or "Abstract")
    app.getType = function (url);
    // Return the id parsed from the url.
    app.getId = function (url, type);
    // Get the title asynchronously, call the callbacks with the id, the type, and the queried title as argument when request done (`callback(id, type, title, newTitle)`).
    // Updates `app`'s 4 variables: `title`, `type`, `id`, `newTitle` before callback.
    app.getTitleAsync = function (id, type, callback, callback2);
    // Insert the title into the active tab.
    // After the insertion, the title might be overwritten after the PDF has been loaded.
    app.insertTitle = function (id, type, title, newTitle) {
    // Add a direct download link if is abstract page.
    app.addDownloadLink = function (id, type, title, newTitle);
    // Run this after the page has finish loading.
    app.run = function () {
      var url = location.href;
      var type = app.getType(url);
      var id = app.getId(url, type);
      if (id === null) {
        console.log(app.name, "Error: Not in ArXiv pdf or abstract page, aborted.");
        return;
      }
      app.getTitleAsync(id, type, app.insertTitle, app.addDownloadLink);
    }
    // Change the title again if it has been overwritten (PDF page only).
    app.onMessage = function (tab, sender, sendResponse);
    // Listen for background script's message, since the title might be changed when PDF is loaded.
    chrome.runtime.onMessage.addListener(app.onMessage);
  • browser_action

    • When clicked on Abstract page: Open PDF page in new tab.
    • When clicked on PDF page: Open Abstract page in new tab.
    • Disabled outside ArXiv's domain.

Firefox Documentation

Permissions

  • tabs: On button click, open a new tab and move it to the right of the old active tab.
  • activeTab: Read active tab's title and modify it using the tab's url.
  • webRequest: Intercept ArXiv PDF request.
  • webRequestBlocking: Redirect the ArXiv PDF page to custom PDF container page.
  • bookmarks: When create a new bookmark of the PDF container page, bookmark the actual ArXiv PDF url instead.
  • storage: Save extension configurations.
  • *://export.arxiv.org/*: Query the title of the paper using the paper id retrieved in the tab's url.
  • *://arxiv.org/*: This plugin works on ArXiv's abstract and PDF page.
  • "content_security_policy": "script-src 'self'; object-src 'self' https://arxiv.org https://export.arxiv.org;": For embedding PDF in container.
  • "web_accessible_resources": [ "pdfviewer.html" ]: To redirect from HTTPS to extension custom page requires them to be visible.

Methods

  • background (background.js)

    Mainly describes the methods for button click. (Open new tab)

    Compacted methods:

    var app = {};
    // All logs should start with this.
    app.name = "[arXiv-utils]";
    // For our PDF container.
    app.pdfviewer = "pdfviewer.html";
    app.pdfviewerTarget = "pdfviewer.html?target=";
    // The match pattern for the URLs to redirect
    // Note: https://arxiv.org/pdf/<id> is the direct link, then the url is renamed to https://arxiv.org/pdf/<id>.pdf
    //       we capture only the last url (the one that ends with '.pdf').
    // Adding some extra parameter such as https://arxiv.org/pdf/<id>.pdf?download can bypass this capture.
    app.redirectPatterns = ["*://arxiv.org/*.pdf", "*://export.arxiv.org/*.pdf",
                            "*://arxiv.org/pdf/*", "*://export.arxiv.org/pdf/*"];
    // Return the type parsed from the url. (Returns "PDF" or "Abstract")
    app.getType = function (url);
    // Return the id parsed from the url.
    app.getId = function (url, type);
    // Open the abstract / PDF page using the current URL.
    app.openAbstractTab = function (activeTabIdx, url, type);
    // Check if the URL is abstract or PDF page, returns true if the URL is either.
    app.checkURL = function (url);
    // Called when the url of a tab changes.
    app.updateBrowserActionState = function (tabId, changeInfo, tab);
    // Redirect to custom PDF page.
    app.redirect = function (requestDetails);
    // If the custom PDF page is bookmarked, bookmark the original PDF link instead.
    app.modifyBookmark = function (id, bookmarkInfo);
    // Run this when the button clicked.
    app.run = function (tab) {
      if (!app.checkURL(tab.url)) {
        console.log(app.name, "Error: Not arXiv page.");
        return;
      }
      var type = app.getType(tab.url);
      app.openAbstractTab(tab.index, tab.url, type);
    }
    // Listen for any changes to the URL of any tab.
    chrome.tabs.onUpdated.addListener(app.updateBrowserActionState);
    // Extension button click to modify title.
    chrome.browserAction.onClicked.addListener(app.run);
    // Redirect the PDF page to custom PDF container page.
    chrome.webRequest.onBeforeRequest.addListener(
      app.redirect,
      { urls: app.redirectPatterns },
      ["blocking"]
    );
    // Capture bookmarking custom PDF page.
    chrome.bookmarks.onCreated.addListener(app.modifyBookmark);
  • content_scripts (content.js)

    Mainly describes what will be run when page loaded. (Modify tab title)

    Runs at document_end (The DOM has finished loading, but resources such as scripts and images may still be loading.) for urls: *://arxiv.org/abs/*.

    Compacted methods:

    var app = {};
    // All logs should start with this.
    app.name = "[arXiv-utils]";
    // These 2 below are for inserting download link.
    app.firstAuthor = undefined;
    app.publishedYear = undefined;
    // Return the id parsed from the url.
    app.getId = function (url);
    // Get the title asynchronously, call the callbacks with the id, the type, and the queried title as argument when request done (`callback(id, type, title, newTitle)`).
    app.getTitleAsync = function (id, type, callback, callback2);
    // Insert the title into the active tab.
    app.insertTitle = function (id, title, newTitle);
    // Add a direct download link if is abstract page.
    app.addDownloadLink = function (id, title, newTitle);
    // Run this after the page has finish loading.
    app.run = function () {
      var url = location.href;
      var id = app.getId(url);
      if (id === null) {
        console.log(app.name, "Error: Not in ArXiv pdf or abstract page, aborted.");
        return;
      }
      app.getTitleAsync(id, "Abstract", app.insertTitle, app.addDownloadLink);
    }
  • browser_action

    • When clicked on Abstract page: Open PDF page in new tab.
    • When clicked on PDF page: Open Abstract page in new tab.
    • Disabled outside ArXiv's domain.
  • PDF container (pdfviewer.html, pdfviewer.js) Embed the target pdf (retrieved from url parameter) in the page.

    var app = {};
    app.name = "[arXiv-utils]";
    // Return the id parsed from the url.
    app.getId = function (url);
    // Get the title asynchronously, call the callback with title as argument when request done.
    app.getTitleAsync = function (id, type, callback);
    // Insert the title into the active tab.
    app.insertTitle = function (title);
    // Extract the pdf url from 'pdfviewer.html?target=<pdfURL>'.
    app.extractURL = function ();
    // Inject embedded PDF.
    app.injectPDF = function (url);
    // Run this once.
    app.run = function () {
      var pdfURL = app.extractURL();
      var id = app.getId(pdfURL);
      app.getTitleAsync(id, "PDF", app.insertTitle);
      app.injectPDF(pdfURL);
    }

Test Flow (Manually)

Let's use this paper: Exploration via Flow-Based Intrinsic Rewards for example.

For Chrome, the Inspector can be opened to see the logs. Make sure there are no errors after performing the actions below:

For Firefox, the Inspector and Add-on Debugger can be opened to see the logs. Other installed add-ons may pollute the logs.

  • The extension button should be disabled outside ArXiv's domain.

  • Open abstract page, the title should be changed to Exploration via Flow-Based Intrinsic Rewards | Abstract instead of [1905.10071] Exploration via Flow-Based Intrinsic Rewards.

  • Click the extension button, the new PDF page should be opened at the right of the abstract page.

  • The opened PDF page should have title Exploration via Flow-Based Intrinsic Rewards | PDF instead of 1905.10071.pdf.

  • Firefox Only The PDF tab should have a long URL, which mean that the PDF are in the extension container.

  • Click the extension button, the new abstract page should be opened at the right of the PDF page.

  • Try to bookmark the abstract tab, the title should be the new title.

  • Try to bookmark the PDF tab, the title should be the new title.

  • Firefox Only Check the PDF bookmark's URL, it should be the original ArXiv PDF link.

  • Chrome Only If OneTab is installed, click its extension button, the list should show the updated titles of both abstract and PDF page.

  • Test PDF urls:

  • Test PDF download (Download PDF (arxiv-utils)) in abstract. In firefox, only mouse left-click works, middle-click open up the original PDF page in a new tab.

    • Change filename format options, reload page, and download to verify the filename is changed.
    • Reset filename format option to default, reload page, and download to verify the filename format is default.

Related Extensions

  • arXiv-title-fixer that works well on Google Chrome. This requires a button click to change the pdf title, but will be considered less intrusive than running in the background.
  • arxiv-url This claims to add a back button, but I can't get it working.
  • redirectify Automatically redirect PDF links to HTML index page for many academic paper sites.

Privacy Policy

We do not gather your personal data. If in doubt, please refer to the source code.

Comments
  • Tranform HTTP urls to HTTPS to honour the CSP

    Tranform HTTP urls to HTTPS to honour the CSP

    Hello,

    Using HTTP urls results in an empty page, because the content cannot be loaded due to CSP violation.

    Why are you using HTTP urls ?

    When using http://www.arxiv-sanity.com/ , the PDF link is in HTTP.

    Then arXiv-sanity should upgrade to put HTTPS links

    That's what I thought. However, they are getting the URL straight from the arXiv API response, e.g. this ling gives an XML where we can see they refer to the link in HTTP :(

    Also, the HTTP link doesn't result on malfunction on their end.

    opened by cipri-tom 7
  • Feature request: pdf links to abs

    Feature request: pdf links to abs

    Thanks a lot for the great plugin!

    Would it be possible to have a direct way to get from an arxiv.org/pdf/... hyperlink to to the abs page?

    Right now (on firefox) I have to

    1. left click the link,
    2. select 'cancel' in the download dialog,
    3. click the arxiv-utils browser button to get to the abs page, (4. select the added 'Direct Download' link.)

    The following solutions would be improvements; the first one or being able to choose one in the extension's preferences would be best in my opinion:

    1. standard arxiv pdf links directly lead to the abs page on left click,
    2. right click on standard arxiv pdf links offers option to go to abs page, (3. standard arxiv pdf links lead to download with the paper's title as filename (like the arxiv-utils 'Direct Download' link on the abs page.)
    opened by j-cb 6
  • Naming Convention

    Naming Convention

    Is it possible to add a naming convention option? "Article Title Author 1 Year" is the default one, however an option of Pascal case naming convention i.e., "ArticleTitleAuthor1Year" would be very good. Thanks in advance.

    enhancement 
    opened by htsenyasa 2
  • Arxiv pages not loading on FireFox 86.0

    Arxiv pages not loading on FireFox 86.0

    Hi,

    I really love this add-on, but unfortunately arxiv pages are no longer loading for me on FireFox 86.0. When I downgrade to 85.0.2 everything works correctly again.

    I know very little about Javascript or how browsers work, but when I press F12, I get the following:

    Works fine: 0.85.0.2

    [arXiv-utils] Retrieving title through ArXiv API request... pdfviewer.js:19:11
    [arXiv-utils] Injecting PDF: https://arxiv.org/pdf/2011.01277.pdf pdfviewer.js:52:11
    PDF c0fd665b66572ff7d2f6a12502d83637 [1.5 pdfTeX-1.40.21 / LaTeX with hyperref] (PDF.js: 2.7.345)
    

    Does not load (white page): 0.86

    [arXiv-utils] Retrieving title through ArXiv API request... pdfviewer.js:19:11
    [arXiv-utils] Injecting PDF: https://arxiv.org/pdf/2008.02941.pdf pdfviewer.js:52:11
    Content Security Policy: The page’s settings blocked the loading of a resource at https://arxiv.org/pdf/2008.02941.pdf (“object-src”).
    Cookie “arxiv_bibex” will be soon treated as cross-site cookie against “https://export.arxiv.org/api/query?id_list=2008.02941” because the scheme does not match.
    

    The third line is in red and says error, whereas the 4th line is a warning.

    Any idea on what might be wrong? I'm on Ubuntu 16.04.

    opened by therooler 2
  • The title of PDF page is the pdf's title (as opposed to paper title)

    The title of PDF page is the pdf's title (as opposed to paper title)

    For example, page title for pdf of https://arxiv.org/abs/1906.07413 is "Sharelatex Example" instead of "Learning Imbalanced Datasets with Label-Distribution-Aware Margin Loss"

    opened by alicanb 1
  • Automated build and publish

    Automated build and publish

    https://github.com/mozilla/web-ext

    Chrome: https://developer.chrome.com/docs/extensions/mv3/tut_debugging/ https://developer.chrome.com/docs/webstore/using_webstore_api/ https://github.com/fregante/chrome-webstore-upload

    Firefox: https://blog.mozilla.org/addons/2022/03/17/new-api-for-submitting-and-updating-add-ons/

    Edge: https://learn.microsoft.com/en-us/microsoft-edge/extensions-chromium/publish/api/using-addons-api

    opened by j3soon 0
  • Make Firefox extension support PDF navigation via included PDF viewer

    Make Firefox extension support PDF navigation via included PDF viewer

    Hi,

    As discussed in #4 , we cannot navigate in the PDF. This is due to the embedded PDF not allowing history: https://github.com/mozilla/pdf.js/blob/c791e01bfc280fb6abc476dece21c6a88d2340df/web/app.js#L525-L527

    They do this on purpose: https://github.com/mozilla/pdf.js/issues/8121

    So the only solution is to have our own PDF viewer, and hope that some day Firefox will enable either content_scripts on PDF, or a WebExtension PDF that serves as API, which we could extend.

    In this PR I add the original pdf.js repo, and link it to the extension code. Here's how it looks:

    https://user-images.githubusercontent.com/2991890/209977019-fc7c5043-ee2b-4f38-bfa2-55a6e81d9154.mp4

    (this video does not play on firefox 😕 the irony... )

    Maintainance

    We will need to keep an eye out for new releases of PDF.js and merge them into the repo. I believe this shouldn't be too difficult: pull the newer tag from mozilla, and merge it into arxiv-utils-customisation branch ; then run gulp generic. We can do it by hand the first couple of times, and if it works well, we can add a GitHub action to do it automatically.

    Next steps

    A part I'm not very happy about is the linking from the dist all the way up to the root project. Maybe we can separate them better?

    Finally, one part that I am totally missing is how to build the extension. I think we need to zip certain files, right ? If you have a doc about this, I can add the building scripts (zipping, etc).

    What do you think ?

    opened by cipri-tom 2
  • Allow customizable download subfolder

    Allow customizable download subfolder

    See the links below:

    • https://developer.chrome.com/docs/extensions/reference/downloads/
    • https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/downloads/download

    For arbitrary folders, it may be possible to use mklink or ln command.

    (Feature Request from Twitter: https://twitter.com/aerinykim/status/1465179136624713735)

    opened by j3soon 0
  • Support the old URL scheme

    Support the old URL scheme

    Hi, Thanks for this helpful plugin.

    It looks that arxiv-utils currently does not support the old URL (or identifier) scheme described here when opening abs given a pdf URL, and I think it would be a nice addition to this extension.

    opened by jaekyeom 3
Releases(v1.6.0)
Owner
Johnson
Johnson
One-line your code easily but still with the fun of doing so!

One-liner-iser One-line your code easily but still with the fun of doing so! Have YOU ever wanted to write one-line Python code, but don't have the sa

5 May 04, 2022
Camview - A CLI-tool used to stream CCTV online footage based on URL params

CamView A CLI-tool used to stream CCTV online footage based on URL params Get St

Finn Lancaster 54 Dec 09, 2022
EvDistill: Asynchronous Events to End-task Learning via Bidirectional Reconstruction-guided Cross-modal Knowledge Distillation (CVPR'21)

EvDistill: Asynchronous Events to End-task Learning via Bidirectional Reconstruction-guided Cross-modal Knowledge Distillation (CVPR'21) Citation If y

addisonwang 18 Nov 11, 2022
Explicable Reward Design for Reinforcement Learning Agents [NeurIPS'21]

Explicable Reward Design for Reinforcement Learning Agents [NeurIPS'21]

3 May 12, 2022
Official implementation of Representer Point Selection via Local Jacobian Expansion for Post-hoc Classifier Explanation of Deep Neural Networks and Ensemble Models at NeurIPS 2021

Representer Point Selection via Local Jacobian Expansion for Classifier Explanation of Deep Neural Networks and Ensemble Models This repository is the

Yi(Amy) Sui 2 Dec 01, 2021
《Geo Word Clouds》paper implementation

《Geo Word Clouds》paper implementation

Russellwzr 2 Jan 28, 2022
Unofficial TensorFlow implementation of the Keyword Spotting Transformer model

Keyword Spotting Transformer This is the unofficial TensorFlow implementation of the Keyword Spotting Transformer model. This model is used to train o

Intelligent Machines Limited 8 May 11, 2022
PyTorch Implementation of DSB for Score Based Generative Modeling. Experiments managed using Hydra.

Diffusion Schrödinger Bridge with Applications to Score-Based Generative Modeling This repository contains the implementation for the paper Diffusion

James Thornton 50 Jan 03, 2023
Record radiologists' eye gaze when they are labeling images.

Record radiologists' eye gaze when they are labeling images. Read for installation, usage, and deep learning examples. Why use MicEye Versatile As a l

24 Nov 03, 2022
Evaluating saliency methods on artificial data with different background types

Evaluating saliency methods on artificial data with different background types This repository contains the relevant code for the MedNeurips 2021 subm

2 Jul 05, 2022
Public repository of the 3DV 2021 paper "Generative Zero-Shot Learning for Semantic Segmentation of 3D Point Clouds"

Generative Zero-Shot Learning for Semantic Segmentation of 3D Point Clouds Björn Michele1), Alexandre Boulch1), Gilles Puy1), Maxime Bucher1) and Rena

valeo.ai 15 Dec 22, 2022
Website which uses Deep Learning to generate horror stories.

Creepypasta - Text Generator Website which uses Deep Learning to generate horror stories. View Demo · View Website Repo · Report Bug · Request Feature

Dhairya Sharma 5 Oct 14, 2022
Air Quality Prediction Using LSTM

AirQualityPredictionUsingLSTM In this Repo, i present to you the winning solution of smart gujarat hackathon 2019 where the task was to predict the qu

Deepak Nandwani 2 Dec 13, 2022
A Runtime method overload decorator which should behave like a compiled language

strongtyping-pyoverload A Runtime method overload decorator which should behave like a compiled language there is a override decorator from typing whi

20 Oct 31, 2022
Everything you need to know about NumPy( Creating Arrays, Indexing, Math,Statistics,Reshaping).

Everything you need to know about NumPy( Creating Arrays, Indexing, Math,Statistics,Reshaping).

1 Feb 14, 2022
A Kernel fuzzer focusing on race bugs

Razzer: Finding kernel race bugs through fuzzing Environment setup $ source scripts/envsetup.sh scripts/envsetup.sh sets up necessary environment var

Systems and Software Security Lab at Seoul National University (SNU) 328 Dec 26, 2022
PyTorch trainer and model for Sequence Classification

PyTorch-trainer-and-model-for-Sequence-Classification After cloning the repository, modify your training data so that the training data is a .csv file

NhanTieu 2 Dec 09, 2022
A PyTorch implementation of "Predict then Propagate: Graph Neural Networks meet Personalized PageRank" (ICLR 2019).

APPNP ⠀ A PyTorch implementation of Predict then Propagate: Graph Neural Networks meet Personalized PageRank (ICLR 2019). Abstract Neural message pass

Benedek Rozemberczki 329 Dec 30, 2022
Official repository for the paper, MidiBERT-Piano: Large-scale Pre-training for Symbolic Music Understanding.

MidiBERT-Piano Authors: Yi-Hui (Sophia) Chou, I-Chun (Bronwin) Chen Introduction This is the official repository for the paper, MidiBERT-Piano: Large-

137 Dec 15, 2022