Example 1: A simple Plugin To make a simple example plugin, perform the following steps: Find your Badboy Installation directory and the "plugins" folder inside it. Inside the "plugins" folder, make a new directory called "testplugin". Inside the "testplugin" directory, make a new file called "init.js" with a text editor (such as Notepad). In the init.js file, place the following JavaScript command: badboy.plugin.addView("testplugin","testplugin","test.html"); In the same directory, add a file called "test.html", and in it the following HTML: <html> <head> type="text/css"> <style * font-family: { arial; } body overflow: auto; { } </style> type="text/javascript"> <script function init() { window.setInterval(update,2000); } function update() { window.external.summary(1,"played"); var played = document.getElementById('played').innerHTML = "Played: " + played; document.getElementById('linkcount').innerHTML = "Links: " + window.plugin.browser("").document.links.length; } </script> </head> <body onload="init();"> Plugin</h2> <h2>Example id="played">&nbsp;</p> <p id="linkcount">&nbsp;</p> <p </body> </html> Restart Badboy When you restart Badboy you should find that the plugin adds a new view to your Badboy window which contains information that updates as you play your script and tells you how many items have played and also the number of links on the current page in the main browser window. You will also see that a new entry has been added to the "View" menu to show the plugin in case the user closes the plugin's view. Example 2: Adding a tool to the Toolbox
Example 1: A simple Plugin To make a simple example plugin, perform the following steps: Find your Badboy Installation directory and the "plugins" folder inside it. Inside the "plugins" folder, make a new directory called "testplugin". Inside the "testplugin" directory, make a new file called "init.js" with a text editor (such as Notepad). In the init.js file, place the following JavaScript command: badboy.plugin.addView("testplugin","testplugin","test.html"); In the same directory, add a file called "test.html", and in it the following HTML: <html> <head> <style type="text/css"> * { font-family: arial; } body { overflow: auto; } </style> <script type="text/javascript"> function init() { window.setInterval(update,2000); } function update() { var played = window.external.summary(1,"played"); document.getElementById('played').innerHTML = "Played: " + played; document.getElementById('linkcount').innerHTML = "Links: " + window.plugin.browser("").document.links.length; } </script> </head> <body onload="init();"> <h2>Example Plugin</h2> <p id="played">&nbsp;</p> <p id="linkcount">&nbsp;</p> </body> </html> Restart Badboy When you restart Badboy you should find that the plugin adds a new view to your Badboy window which contains information that updates as you play your script and tells you how many items have played and also the number of links on the current page in the main browser window. You will also see that a new entry has been added to the "View" menu to show the plugin in case the user closes the plugin's view. Example 2: Adding a tool to the Toolbox
Badboy_v2.1_User_Doc.docx