1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-09 09:24:10 +01:00

Minorish refactoring.

This commit is contained in:
Kris Maglione
2011-09-08 10:22:43 -04:00
parent e9a0b1eea3
commit c6035ce674
7 changed files with 227 additions and 147 deletions

View File

@@ -629,7 +629,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
getFile: function getFile(uri) {
try {
if (isString(uri))
uri = util.newURI(util.fixURI(uri));
uri = util.newURI(uri);
if (uri instanceof Ci.nsIFileURL)
return File(uri.file);
@@ -837,6 +837,10 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
* @returns {nsIURI}
*/
newURI: function newURI(uri, charset, base) {
let idx = uri.lastIndexOf(" -> ");
if (~idx)
uri = uri.slice(idx + 4);
let res = this.withProperErrors("newURI", services.io, uri, charset, base);
res instanceof Ci.nsIURL;
return res;