jailed: Basic example doesn't work

Sorry if this is due to a lack-of-understanding on my part, but I can’t get this to work. I’m running it locally, and I’ve tried it in Chrome and Safari on Mac.

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="jailed.js"></script>
</head>
<body>
    <div id="content"></div>
    <script>
        var api = {
            alert: alert
        };

        var pluginCode = "application.setInterface({\n";
        pluginCode += "foo: function() {\n";
        pluginCode += " application.remote.alert('hi');\n";
        pluginCode += "}});"

        console.log(pluginCode);


        var plugin = new jailed.Plugin(pluginCode, api);

        plugin.remote.foo();
    </script>
<body>
</html>

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

It may be obvious but in addition to jailed.js all other files from lib folder must be also available. If these files are around the basic example works.