This userscript makes you to always see the canonical ("current") version of PostgreSQL docs instead of the specific (usually outdated) version of that.
Distributed under public domain.
| // ==UserScript== | |
| // @name Redirect to Canonical Postgres Docs | |
| // @namespace https://gist.github.com/dahlia/1912c2dd9d86fa3aabca37d3acc041ea | |
| // @description Always show canonical Postgres docs | |
| // @match https://postgresql.org/docs/*.*/static/* | |
| // @match http://postgresql.org/docs/*.*/static/* | |
| // @match https://www.postgresql.org/docs/*.*/static/* | |
| // @match http://www.postgresql.org/docs/*.*/static/* | |
| // @exclude https://www.postgresql.org/docs/current/static/* | |
| // @version 2 | |
| // @grant none | |
| // ==/UserScript== | |
| (function () { | |
| var m = location.pathname.match(/^\/docs\/\d+\.\d+\/static\/(.*)$/); | |
| if (m !== null) { | |
| var prefix = 'https://www.postgresql.org/docs/current/static/', | |
| suffix = m[1] + location.search + location.hash; | |
| location.href = prefix + suffix; | |
| } | |
| })(); |
After pg 10 released, this script has to be updated! And I think that there is some modification on URL of PostgreSQL documentation. (
/staticwas removed.)