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

Use URI fixup service to convert path to URI for :source

This commit is contained in:
Kris Maglione
2008-10-11 06:43:55 +00:00
parent e69cba9ff3
commit 2368a1c979

View File

@@ -758,8 +758,7 @@ lookup:
}
liberator.echomsg("sourcing \"" + filename + "\"", 2);
let str = ioManager.readFile(file);
let uri = PlacesUIUtils.createFixedURI(file.path).spec
// handle pure javascript files specially
if (/\.js$/.test(filename))
@@ -768,7 +767,7 @@ lookup:
.getService(Components.interfaces.mozIJSSubScriptLoader);
try
{
loader.loadSubScript("file://" + file.path, liberator)
loader.loadSubScript(uri, liberator)
}
catch (e)
{
@@ -778,10 +777,11 @@ lookup:
}
else if (/\.css$/.test(filename))
{
liberator.storage.styles.registerSheet("file://" + file.path, !silent, true);
liberator.storage.styles.registerSheet(uri, !silent, true);
}
else
{
let str = ioManager.readFile(file);
let heredoc = "";
let heredocEnd = null; // the string which ends the heredoc
let lines = str.split("\n");