1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-28 09:02:26 +01:00

Restore YouTube shortlink hack.

YouTube is broken again.
This commit is contained in:
Doug Kearns
2014-11-14 21:43:02 +11:00
parent 03402bd411
commit 2acf4a6997

View File

@@ -2765,6 +2765,13 @@ Buffer.addPageInfoSection("s", "Security", function (verbose) {
}
});
// internal navigation doesn't currently update link[rel='shortlink']
Buffer.addURIShortener("youtube.com", (uri, doc) => {
let video = array.toObject(uri.query.split("&")
.map(p => p.split("="))).v;
return video ? util.newURI("http://youtu.be/" + video) : null;
});
// catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
endModule();