I am trying to display a modal Javascript dialog box in Chrome when a user creates a bookmark. However, after trying Closure and SimpleModal+JQuery, I can't seem to get a dialog box to appear. Is this a restriction of extensions in Chrome, or am I doing something very wrong? (I'm still learning Javascript, so my lack of understanding it could very well be the reason.)
Here is my code using Closure. It does make it into the function, so that's working okay. Any suggestions? Thanks!
<html>
<head>
<script src="./lib/closure-library/closure/goog/base.js"></script>
<script type="text/javascript" src="./lib/closure-library/closure/goog/deps.js"></script>
<script>goog.require('goog.ui.Dialog');</script>
<script type="text/javascript">
chrome.bookmarks.onCreated.addListener(function(id, bookmark) {
// Setup the dialog box.
var dialog1 = new goog.ui.Dialog();
dialog1.setContent('[Insert Placeholder]');
dialog1.setTitle('Title Placeholder');
// Display dialog.
dialog1.setVisible(true);
});
</script>
</head>
<body>
<!-- Do Nothing -->
</body>
</html>