| Comments

someone asked if would work in an ...interesting thought i felt.  after all, the dashboard widget concept is similar to the sidebar gadget feature in vista in that it is essentially a packaged file with html, javascript, images, etc.  so i went to task and tried it out.

i first started with a media player that i had been working on and it didn't go so well...more on that at a later time (startup javascripts, etc.).  after that i just dumbed it down to a simple sample that had some animation and stuff.

packaged it up, deploy to dashboard...and...

nothing.

hmm...what is going on here.  ah, yes, there is a setting in the dashboard widget that requires you to turn it on to allow internet plugins to work...modify to enable, redeploy.

nothing.  blech.  actually, not "nothing" but the default install prompt for silverlight -- which upon clicking did nothing.

with some pointers, i started realizing that the dashboard is likely not registering as "safari" or "firefox" or anything of the like.  it's built using , but perhaps that is the problem.  some others pointed me to that it is likely a conflict with the detection script in silverlight.js and not being able to figure something out.

so i changed to hard-code in the embed/object tag and then was able to get it working like this:

<div id="SilverlightControlHost" class="silverlightHost">

    <object type="application/ag-plugin" id="SilverlightControl" height="100%" width="100%">
        <param name="source" value="Scene.xaml">
        <param name="onError" value="default_error_handler">
        <param name="onLoad" value="javascript:_sl0">

    </object>
    
</div>

i wouldn't necessarily recommend using the object tag as the detection script works perfectly in typical browser situations (typical meaning != dashboards or other hosted models).  i'm going to take a look at the detection script next to see if hacking it up might make this work easier.

i can't figure out how to take a screenshot of a dashboard gadget working (capture doesn't work in the dashboard view), so you'll have to take my word for it.  if you want to try it out on your osx dashboard yourself, the test file is at the end of this post.  I also did a quick and dirty wrapper of lutz roeder's digger to see if it would work.  the keyboard interaction doesn't, but again i suspect that is some javascript hacking that needs to be modified in the engine script (of digger) to enable it working in webkit.

File: SLDash.zip
File: Digger.zip

Please enjoy some of these other recent posts...

Comments