1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-16 12:05:47 +01:00

Give *.penta plugins their own JS sandboxen.

--HG--
branch : key-processing
This commit is contained in:
Kris Maglione
2011-01-26 14:35:58 -05:00
parent b051e4edc2
commit 787f063692
5 changed files with 18 additions and 6 deletions

View File

@@ -185,8 +185,10 @@ var IO = Module("io", {
else if (/\.css$/.test(filename))
styles.registerSheet(uri.spec, false, true);
else {
if (!(file.path in plugins))
plugins[file.path] = modules.newContext(modules.userContext);
modules.commands.execute(file.read(), null, silent || "loud", null,
{ file: file.path, line: 1 });
{ file: file.path, line: 1, context: plugins[file.path] });
}
if (this._scriptNames.indexOf(file.path) == -1)