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
🛠️ SLAMcore SLAM Utilities

slamcore_utils Description This repo contains the slamcore-setup-dataset script. It can be used for installing a sample dataset for offline testing an

SLAMcore 7 Aug 04, 2022
The official pytorch implementation of our paper "Is Space-Time Attention All You Need for Video Understanding?"

TimeSformer This is an official pytorch implementation of Is Space-Time Attention All You Need for Video Understanding?. In this repository, we provid

Facebook Research 1k Dec 31, 2022
Object Depth via Motion and Detection Dataset

ODMD Dataset ODMD is the first dataset for learning Object Depth via Motion and Detection. ODMD training data are configurable and extensible, with ea

Brent Griffin 172 Dec 21, 2022
MARS: Learning Modality-Agnostic Representation for Scalable Cross-media Retrieva

Introduction This is the source code of our TCSVT 2021 paper "MARS: Learning Modality-Agnostic Representation for Scalable Cross-media Retrieval". Ple

7 Aug 24, 2022
A LiDAR point cloud cluster for panoptic segmentation

Divide-and-Merge-LiDAR-Panoptic-Cluster A demo video of our method with semantic prior: More information will be coming soon! As a PhD student, I don'

YimingZhao 65 Dec 22, 2022
Hitters Linear Regression - Hitters Linear Regression With Python

Hitters_Linear_Regression Kullanacağımız veri seti Carnegie Mellon Üniversitesi'

AyseBuyukcelik 2 Jan 26, 2022
Code for the CVPR2022 paper "Frequency-driven Imperceptible Adversarial Attack on Semantic Similarity"

Introduction This is an official release of the paper "Frequency-driven Imperceptible Adversarial Attack on Semantic Similarity" (arxiv link). Abstrac

Leo 21 Nov 23, 2022
Evaluation and Benchmarking of Speech Super-resolution Methods

Speech Super-resolution Evaluation and Benchmarking What this repo do: A toolbox for the evaluation of speech super-resolution algorithms. Unify the e

Haohe Liu (刘濠赫) 84 Dec 20, 2022
The 2nd place solution of 2021 google landmark retrieval on kaggle.

Leaderboard, taxonomy, and curated list of few-shot object detection papers.

229 Dec 13, 2022
Precomputed Real-Time Texture Synthesis with Markovian Generative Adversarial Networks

MGANs Training & Testing code (torch), pre-trained models and supplementary materials for "Precomputed Real-Time Texture Synthesis with Markovian Gene

290 Nov 15, 2022
Pytorch implementation of the paper DocEnTr: An End-to-End Document Image Enhancement Transformer.

DocEnTR Description Pytorch implementation of the paper DocEnTr: An End-to-End Document Image Enhancement Transformer. This model is implemented on to

Mohamed Ali Souibgui 74 Jan 07, 2023
Official implementation of the RAVE model: a Realtime Audio Variational autoEncoder

Official implementation of the RAVE model: a Realtime Audio Variational autoEncoder

Antoine Caillon 589 Jan 02, 2023
Plotting points that lie on the intersection of the given curves using gradient descent.

Plotting intersection of curves using gradient descent Webapp Link --- What's the app about Why this app Plotting functions and their intersection. A

Divakar Verma 2 Jan 09, 2022
Code for Talking Face Generation by Adversarially Disentangled Audio-Visual Representation (AAAI 2019)

Talking Face Generation by Adversarially Disentangled Audio-Visual Representation (AAAI 2019) We propose Disentangled Audio-Visual System (DAVS) to ad

Hang_Zhou 750 Dec 23, 2022
Image inpainting using Gaussian Mixture Models

dmfa_inpainting Source code for: MisConv: Convolutional Neural Networks for Missing Data (to be published at WACV 2022) Estimating conditional density

Marcin Przewięźlikowski 8 Oct 09, 2022
Pcos-prediction - Predicts the likelihood of Polycystic Ovary Syndrome based on patient attributes and symptoms

PCOS Prediction 🥼 Predicts the likelihood of Polycystic Ovary Syndrome based on

Samantha Van Seters 1 Jan 10, 2022
Bulk2Space is a spatial deconvolution method based on deep learning frameworks

Bulk2Space Spatially resolved single-cell deconvolution of bulk transcriptomes using Bulk2Space Bulk2Space is a spatial deconvolution method based on

Dr. FAN, Xiaohui 60 Dec 27, 2022
Consistency Regularization for Adversarial Robustness

Consistency Regularization for Adversarial Robustness Official PyTorch implementation of Consistency Regularization for Adversarial Robustness by Jiho

40 Dec 17, 2022
Extracts data from the database for a graph-node and stores it in parquet files

subgraph-extractor Extracts data from the database for a graph-node and stores it in parquet files Installation For developing, it's recommended to us

Cardstack 0 Jan 10, 2022
Code release for ICCV 2021 paper "Anticipative Video Transformer"

Anticipative Video Transformer Ranked first in the Action Anticipation task of the CVPR 2021 EPIC-Kitchens Challenge! (entry: AVT-FB-UT) [project page

Facebook Research 123 Dec 13, 2022