Open in nbviewer Chrome Extension

I got tired of pasting URLs into nbviewer so I made a Chrome extension that will try to load your current page via nbviewer.

For example, if you are at you can click the “Open in nbviewer” extension button and it will load in a new tab. It also works for URLs ending in .ipynb.

You can download the extension from the Chrome Web Store and see the code on GitHub.

I took the extension icon from the nbviewer favicon, so thanks to them for that! Thanks also for making something as awesome as nbviewer, it’s getting so I couldn’t live without it!

7 thoughts on “Open in nbviewer Chrome Extension

  1. Hi there,

    Nice job to have done that !

    I have 1 question and 2 comment,
    First the comments,

    For https urls, nbviewer url are actually /urls/[ipynb url]
    Both url/urls works for gists, but for some websites, the https protocol is mandatory.

    Also you can POST the value `gistnorurl=your_url` to and it should redirect to the right URL.

    And If you allow me, I would be happy to put a link to this post on nbviewer frontpage.
    Do you agree ?

    Thanks for advertising nbviewer, and writing the chrome extension, feel free to write to the dev list if you think anything useful could be added to the frontpage.


    • Hi Matthias, thanks for the info, I clearly wasn’t reading the nbviewer code close enough! I’ll update the https url as soon as I can.

      I did play around with doing a POST but the problem is that it has to wait for nbviewer to do all the conversion and rendering before getting a response. It’s basically loading the page twice. Not that nbviewer is slow, but that makes the extension slightly less responsive. (Unlike using the requests library in Python, I couldn’t find a way in JavaScript to make a request not follow a redirect.)

      Putting the logic in the extension also allows it to do nothing when the current page doesn’t match any of the regex, instead of opening an error page.

      I’d be flattered to see this on the front page of nbviewer, please do! The bookmarklet I made for non-Chrome users would also probably be of interest.

      • When i have more time I’ll try to make a better api for nbviewer so that it send a json response with information.

        In the meantime you might be interested in trying dev-version

        My first thought was to post this comment on the bookmarklet page, but I might have use the wrong tabs, so i’ll put the link to the bookmarklet post when I’ve a little more time.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s