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
Exemplo de implementação do padrão circuit breaker em python

fast-circuit-breaker Circuit breakers existem para permitir que uma parte do seu sistema falhe sem destruir todo seu ecossistema de serviços. Michael

James G Silva 17 Nov 10, 2022
ToFFi - Toolbox for Frequency-based Fingerprinting of Brain Signals

ToFFi Toolbox This repository contains "before peer review" version of the software related to the preprint of the publication ToFFi - Toolbox for Fre

4 Aug 31, 2022
Multi-atlas segmentation (MAS) is a promising framework for medical image segmentation

Multi-atlas segmentation (MAS) is a promising framework for medical image segmentation. Generally, MAS methods register multiple atlases, i.e., medical images with corresponding labels, to a target i

NanYoMy 13 Oct 09, 2022
GPU implementation of $k$-Nearest Neighbors and Shared-Nearest Neighbors

GPU implementation of kNN and SNN GPU implementation of $k$-Nearest Neighbors and Shared-Nearest Neighbors Supported by numba cuda and faiss library E

Hyeon Jeon 7 Nov 23, 2022
A package, and script, to perform imaging transcriptomics on a neuroimaging scan.

Imaging Transcriptomics Imaging transcriptomics is a methodology that allows to identify patterns of correlation between gene expression and some prop

Alessio Giacomel 10 Dec 27, 2022
Dictionary Learning with Uniform Sparse Representations for Anomaly Detection

Dictionary Learning with Uniform Sparse Representations for Anomaly Detection Implementation of the Uniform DL Representation for AD algorithm describ

Paul Irofti 1 Nov 23, 2022
Decision Transformer: A brand new Offline RL Pattern

DecisionTransformer_StepbyStep Intro Decision Transformer: A brand new Offline RL Pattern. 这是关于NeurIPS 2021 热门论文Decision Transformer的复现。 👍 原文地址: Deci

Irving 14 Nov 22, 2022
NudeNet: Neural Nets for Nudity Classification, Detection and selective censoring

NudeNet: Neural Nets for Nudity Classification, Detection and selective censoring Uncensored version of the following image can be found at https://i.

notAI.tech 1.1k Dec 29, 2022
On Out-of-distribution Detection with Energy-based Models

On Out-of-distribution Detection with Energy-based Models This repository contains the code for the experiments conducted in the paper On Out-of-distr

Sven 19 Aug 07, 2022
Code for our ACL 2021 paper "One2Set: Generating Diverse Keyphrases as a Set"

One2Set This repository contains the code for our ACL 2021 paper “One2Set: Generating Diverse Keyphrases as a Set”. Our implementation is built on the

Jiacheng Ye 63 Jan 05, 2023
SegNet-Basic with Keras

SegNet-Basic: What is Segnet? Deep Convolutional Encoder-Decoder Architecture for Semantic Pixel-wise Image Segmentation Segnet = (Encoder + Decoder)

Yad Konrad 81 Jun 30, 2022
Implementation of "RaScaNet: Learning Tiny Models by Raster-Scanning Image" from CVPR 2021.

RaScaNet: Learning Tiny Models by Raster-Scanning Images Deploying deep convolutional neural networks on ultra-low power systems is challenging, becau

SAIT (Samsung Advanced Institute of Technology) 5 Dec 26, 2022
tsai is an open-source deep learning package built on top of Pytorch & fastai focused on state-of-the-art techniques for time series classification, regression and forecasting.

Time series Timeseries Deep Learning Pytorch fastai - State-of-the-art Deep Learning with Time Series and Sequences in Pytorch / fastai

timeseriesAI 2.8k Jan 08, 2023
Xview3 solution - XView3 challenge, 2nd place solution

Xview3, 2nd place solution https://iuu.xview.us/ test split aggregate score publ

Selim Seferbekov 24 Nov 23, 2022
Deformable DETR is an efficient and fast-converging end-to-end object detector.

Deformable DETR: Deformable Transformers for End-to-End Object Detection.

2k Jan 05, 2023
Meli Data Challenge 2021 - First Place Solution

My solution for the Meli Data Challenge 2021

Matias Moreyra 23 Mar 09, 2022
Machine Learning automation and tracking

The Open-Source MLOps Orchestration Framework MLRun is an open-source MLOps framework that offers an integrative approach to managing your machine-lea

873 Jan 04, 2023
DGCNN - Dynamic Graph CNN for Learning on Point Clouds

DGCNN is the author's re-implementation of Dynamic Graph CNN, which achieves state-of-the-art performance on point-cloud-related high-level tasks including category classification, semantic segmentat

Wang, Yue 1.3k Dec 26, 2022
Discover hidden deepweb pages

DeepWeb Scapper Att: Demo version An simple script to scrappe deepweb to find pages. Will return if any of those exists and will save on a file. You s

Héber Júlio 77 Oct 02, 2022
Keras Model Implementation Walkthrough

Keras Model Implementation Walkthrough

Luke Wood 17 Sep 27, 2022