Skip to content

Instantly share code, notes, and snippets.

@karthikeyann
Last active August 29, 2015 14:04
Show Gist options
  • Save karthikeyann/ba6c5669057695529416 to your computer and use it in GitHub Desktop.
Save karthikeyann/ba6c5669057695529416 to your computer and use it in GitHub Desktop.
PDFJS sometimes does not load pdf becuase range requests are disable in proxy servers. This greasemonkey script automatically reloads the page disabling range using hashparams in url.
// ==UserScript==
// @name Firefox PDFJS
// @namespace poulet
// @include /^(http|https|file)://.*.pdf$/
// @version 1
// @grant none
// ==/UserScript==
// NOTE: Reloads the PDF by disabling Range requests for some proxies.
// NOTE: Useful for Firefox PDFJS viewer for proxies without range requests (ex: proxy inside IIT Madras)
var url=window.location
var newurl= url + '#disableRange=true'
window.location = newurl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment