Access an embed object via javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Phil

    Access an embed object via javascript

    Hi,

    I want to access the features of a plugin without actually embedding
    it into a page. Is this possible?

    Eg

    The code to embed the object into a page is:

    <OBJECT classid='CLSID: 7FA62735-AHC3-14d2-9F81-00114B3245C5
    codebase='http://www.test.com/plug.cab#versio n=3,1' "id='myPlug in'
    height='0' width='0'>

    <EMBED type='applicati on/x-myPlugin' name='myPlugin' hidden='true'
    src='in.txt'></EMBED>

    </OBJECT>

    I could simply add this using document.write, but for various reasons
    I dont want to do this.


    I would rather do something like:

    var plugin = (navigator.mime Types &&
    navigator.mimeT ypes["applicatio n/x-Web-Plugin"]) ?
    navigator.mimeT ypes["applicatio n/x-Web-Plugin"].enabledPlugin : 0;

    myObj = new object("CLSID:7 FA62735-AHC3-14d2-9F81-00114B3245C5");

    myObj.pluginMet hod

    Thanks
  • Martin Honnen

    #2
    Re: Access an embed object via javascript



    Phil wrote:

    [color=blue]
    > I want to access the features of a plugin without actually embedding
    > it into a page. Is this possible?
    >
    > Eg
    >
    > The code to embed the object into a page is:
    >
    > <OBJECT classid='CLSID: 7FA62735-AHC3-14d2-9F81-00114B3245C5
    > codebase='http://www.test.com/plug.cab#versio n=3,1' "id='myPlug in'
    > height='0' width='0'>
    >
    > <EMBED type='applicati on/x-myPlugin' name='myPlugin' hidden='true'
    > src='in.txt'></EMBED>
    >
    > </OBJECT>
    >
    > I could simply add this using document.write, but for various reasons
    > I dont want to do this.
    >
    >
    > I would rather do something like:
    >
    > var plugin = (navigator.mime Types &&
    > navigator.mimeT ypes["applicatio n/x-Web-Plugin"]) ?
    > navigator.mimeT ypes["applicatio n/x-Web-Plugin"].enabledPlugin : 0;
    >
    > myObj = new object("CLSID:7 FA62735-AHC3-14d2-9F81-00114B3245C5");
    >
    > myObj.pluginMet hod[/color]

    With MSIE/Win you might be able to use
    var control = new ActiveXObject(' program.id')
    and then script that but you need to find out the program id of that
    CLSID:7FA62735-AHC3-14d2-9F81-00114B3245C5.

    --

    Martin Honnen

    Comment

    • Phil

      #3
      Re: Access an embed object via javascript

      Martin Honnen <mahotrash@yaho o.de> wrote in message news:<41a72b7b$ 0$16034$9b4e6d9 3@newsread4.arc or-online.net>...[color=blue]
      > Phil wrote:
      >
      >[color=green]
      > > I want to access the features of a plugin without actually embedding
      > > it into a page. Is this possible?
      > >
      > > Eg
      > >
      > > The code to embed the object into a page is:
      > >
      > > <OBJECT classid='CLSID: 7FA62735-AHC3-14d2-9F81-00114B3245C5
      > > codebase='http://www.test.com/plug.cab#versio n=3,1' "id='myPlug in'
      > > height='0' width='0'>
      > >
      > > <EMBED type='applicati on/x-myPlugin' name='myPlugin' hidden='true'
      > > src='in.txt'></EMBED>
      > >
      > > </OBJECT>
      > >
      > > I could simply add this using document.write, but for various reasons
      > > I dont want to do this.
      > >
      > >
      > > I would rather do something like:
      > >
      > > var plugin = (navigator.mime Types &&
      > > navigator.mimeT ypes["applicatio n/x-Web-Plugin"]) ?
      > > navigator.mimeT ypes["applicatio n/x-Web-Plugin"].enabledPlugin : 0;
      > >
      > > myObj = new object("CLSID:7 FA62735-AHC3-14d2-9F81-00114B3245C5");
      > >
      > > myObj.pluginMet hod[/color]
      >
      > With MSIE/Win you might be able to use
      > var control = new ActiveXObject(' program.id')
      > and then script that but you need to find out the program id of that
      > CLSID:7FA62735-AHC3-14d2-9F81-00114B3245C5.[/color]

      Thats something like what im looking for, the only problem is that
      this has to work in Mozilla Firefox ( and not IE!).

      Thanks

      Comment

      Working...