Plugin Simulation from JSON Variable

You can construct your own plugins using a JSON variable. This is an example of how the JSON structure can look like:

[
  {
    "name" : "Shockwave Flash",
    "description" : "Shockwave Flash 18.0 r0",
    "filename" : "NPSWF32_18_0_0_232.dll",
    "mimeTypes" : [
                    {
                      "type" : "application/x-shockwave-flash",
                      "description" : "Adobe Flash movie",
                     "suffixes" : "swf"
                    },
                    {
                      "type" : "application/futuresplash",
                      "description" : "FutureSplash movie",
                      "suffixes" : "spl"
                    }
                  ]
  },
  {
    "name" : "Silverlight Plug-In",
    "description" : "Silverlight Plug-In 5.1.40416.0",
    "filename" : "npctrl.dll",
    "mimeTypes" : [
                    {
                      "type" : "application/x-silverlight",
                      "description" : "npctrl",
                      "suffixes" : "scr"
                    },
                    {
                      "type" : "application/x-silverlight-2",
                      "description" : "",
                      "suffixes" : ""
                    }
                  ]
  }
]

You can use the following code to generate a JSON variable to be used in the plugin simulation. Just save the code to an HTML file and open it in a browser. The generated text can then be copied directly to a JSON variable on the Plugins tab of the Options window in Design Studio.

<!doctype html>
<html>
<body>
<div id="plugins"></div>
</body>
<script>
var plugins=[];
for(var n=0; n<navigator.plugins.length; n++) {
          plugins.push({}); 
          plugins[n].name=navigator.plugins[n].name;
          plugins[n].description=navigator.plugins[n].description;
          plugins[n].filename=navigator.plugins[n].filename;
          plugins[n].mimeTypes=[];
          for(var m=0; m<navigator.plugins[n].length; m++) {
                   plugins[n].mimeTypes.push({});
                   plugins[n].mimeTypes[m].type=navigator.plugins[n][m].type;
                    plugins[n].mimeTypes[m].description=navigator.plugins[n][m].description;
                    plugins[n].mimeTypes[m].suffixes=navigator.plugins[n][m].suffixes;
          }
}
var json = document.getElementById("plugins");
json.innerHTML= JSON.stringify(plugins);
</script>
</html>