mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 05:57:58 +01:00
Switch back to the fixup service for sourcing files.
This commit is contained in:
@@ -331,7 +331,7 @@ liberator.Bookmarks = function () //{{{
|
||||
{
|
||||
try
|
||||
{
|
||||
var uri = PlacesUIUtils.createFixedURI(url);
|
||||
var uri = liberator.util.createURI(url);
|
||||
if (!force)
|
||||
{
|
||||
for (let bmark in cache)
|
||||
|
||||
@@ -760,6 +760,7 @@ lookup:
|
||||
liberator.echomsg("sourcing \"" + filename + "\"", 2);
|
||||
|
||||
let str = ioManager.readFile(file);
|
||||
let uri = liberator.util.createURI(file.path);
|
||||
|
||||
// handle pure javascript files specially
|
||||
if (/\.js$/.test(filename))
|
||||
@@ -768,7 +769,7 @@ lookup:
|
||||
.getService(Components.interfaces.mozIJSSubScriptLoader);
|
||||
try
|
||||
{
|
||||
loader.loadSubScript("file://" + file.path, liberator)
|
||||
loader.loadSubScript(uri.spec, liberator)
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
@@ -778,7 +779,7 @@ lookup:
|
||||
}
|
||||
else if (/\.css$/.test(filename))
|
||||
{
|
||||
liberator.storage.styles.registerSheet("file://" + file.path, !silent, true);
|
||||
liberator.storage.styles.registerSheet(uri.spec, !silent, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -107,6 +107,13 @@ liberator.util = { //{{{
|
||||
liberator.echo("Yanked " + str, liberator.commandline.FORCE_SINGLELINE);
|
||||
},
|
||||
|
||||
createURI: function (str)
|
||||
{
|
||||
const fixup = Components.classes["@mozilla.org/docshell/urifixup;1"]
|
||||
.getService(Components.interfaces.nsIURIFixup);
|
||||
return fixup.createFixupURI(str, fixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP);
|
||||
},
|
||||
|
||||
escapeHTML: function (str)
|
||||
{
|
||||
// XXX: the following code is _much_ slower than a simple .replace()
|
||||
|
||||
Reference in New Issue
Block a user