mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 10:08:00 +01:00
Use URI fixup service to convert path to URI for :source
This commit is contained in:
@@ -758,8 +758,7 @@ lookup:
|
|||||||
}
|
}
|
||||||
|
|
||||||
liberator.echomsg("sourcing \"" + filename + "\"", 2);
|
liberator.echomsg("sourcing \"" + filename + "\"", 2);
|
||||||
|
let uri = PlacesUIUtils.createFixedURI(file.path).spec
|
||||||
let str = ioManager.readFile(file);
|
|
||||||
|
|
||||||
// handle pure javascript files specially
|
// handle pure javascript files specially
|
||||||
if (/\.js$/.test(filename))
|
if (/\.js$/.test(filename))
|
||||||
@@ -768,7 +767,7 @@ lookup:
|
|||||||
.getService(Components.interfaces.mozIJSSubScriptLoader);
|
.getService(Components.interfaces.mozIJSSubScriptLoader);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
loader.loadSubScript("file://" + file.path, liberator)
|
loader.loadSubScript(uri, liberator)
|
||||||
}
|
}
|
||||||
catch (e)
|
catch (e)
|
||||||
{
|
{
|
||||||
@@ -778,10 +777,11 @@ lookup:
|
|||||||
}
|
}
|
||||||
else if (/\.css$/.test(filename))
|
else if (/\.css$/.test(filename))
|
||||||
{
|
{
|
||||||
liberator.storage.styles.registerSheet("file://" + file.path, !silent, true);
|
liberator.storage.styles.registerSheet(uri, !silent, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
let str = ioManager.readFile(file);
|
||||||
let heredoc = "";
|
let heredoc = "";
|
||||||
let heredocEnd = null; // the string which ends the heredoc
|
let heredocEnd = null; // the string which ends the heredoc
|
||||||
let lines = str.split("\n");
|
let lines = str.split("\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user