Coder Social home page Coder Social logo

zafarali / redirectify Goto Github PK

View Code? Open in Web Editor NEW

This project forked from imurray/redirectify

0.0 3.0 0.0 7 KB

Browser extension to redirect pages based on rules. Intended to stop the browser following links straight to the PDF of a paper, but instead to go first to the HTML index page for the paper.

License: MIT License

Shell 12.34% JavaScript 87.66%

redirectify's Introduction

Redirectify

Links to academic papers in emails and on websites often point to the PDF of the paper. However, on sites like arXiv, I'd much rather be pointed to the HTML page. The index page is quick to load, and has meta-data not available in the PDF, such as the version history. I've given up trying to ask people not to deep-link to PDFs, and have instead written a browser extension to do what I want.

This browser extension redirects links to PDFs on ACM, arXiv, JMLR, NIPS, OpenReview and PMLR to an HTML index page, unless you clicked on the link from the hosting site. Examples:

I've given the extension a fairly generic name. The redirect rules are stored in a list at the top of the code, and can easily be added to. However, making this list updatable within the extension has been punted to future work.

Download

If you just want to use the extension as it is, get it from one of the official addon sites:

Alternatives

  • arxiv-url-replacer a different Chrome extension for arXiv, with a GUI. Edits links in pages, instead of intercepting requests. A similar approach could be taken using TamperMonkey, which would immediately work in multiple browsers. It can be tricky to catch all links though.

Hacking

If you want to add to the redirect rules, you currently have to edit the source code. To run the extension from the source:

  • Firefox: go to about:debugging and click "Load Temporary Add-on". Select either of the files in the src directory. See Mozilla's WebExtensions documentation for more details.

  • Chrome: go to chrome://extensions check developer mode, click load unpacked extension and select the src directory. See Chrome's extension development getting started guide for more details. I've found the Chrome documentation and API harder to work with than Firefox's. Also the Chrome webstore makes you pay to register as a developer and is less responsive, which is a turn-off for casual development.

The code is written as a WebExtension, originally for Firefox. It works nearly as well from the same code in Chrome. It could probably be made to work in some other browsers, perhaps with some tweaking. But not by me.

redirectify's People

Contributors

imurray avatar zafarali avatar

Watchers

James Cloos avatar  avatar paper2code - bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.