firefox中使用ocx的方法

You'll want to look at this site:  Plugin for Hosting ActiveX Controls [ ^ ]. The site also has some interesting links and also to the source code for that plugin. I'll bet bet this will be a valuable source of information for you.

Modified :
This one's better:  http://code.google.com/p/ff-activex-host/ [ ^ ]. The site sports a links to the source and full documentation.
I think the second link is better as it specifically targets FireFox and the information on the first link seems a bit outdated.

Regards,

Manfred


[转]firefox中使用ocx的方法 嵌入object标签

2014-7-11阅读467 评论0

参考:
http://code.google.com/p/ff-activex-host/

1、下载:
ffactivex-setup-r38.exe
axhost.r38.xpi
chrome.r38.crx

2、安装:打开firefox浏览器,然后将axhost.r38.xpi拖入浏览器(进行注册)。完成后重新启动浏览器。
3、代码写法。
<object
                id="Control"
                TYPE="application/x-itst-activex"
                ALIGN="baseline" BORDER="0"
                WIDTH="300" HEIGHT="300"
                clsid="{D27CDB6E-AE6D-11cf-96B8-444553540000}"
                progid="ShockwaveFlash.ShockwaveFlash"
                event_OnReadyStateChange="OnReady"
                param_src="http://www.youtube.com/v/53RdNYwImYc">
        </object>

其中clsid="{D27CDB6E-AE6D-11cf-96B8-444553540000}"progid="ShockwaveFlash.ShockwaveFlash" 
必须要指定其中的一个属性,WIDTH="300" HEIGHT="300"属性可以设置成0,用来设置是否显示,
但不能用display:none来隐藏。为了与IE浏览器兼容那么只能在重新按IE的格式定义一个OBJECT对象。例如:
firefox中使用:
<object id="FileSelectFF" type="application/x-itst-activex" style="border:0px;width:0px;height:0px;" 
clsid="{C584B594-D081-43E9-8989-01E8B1F8FCED}" progid="FileOperation.CAB#version=1,0,0,1">
  </object>
IE中使用:
  <object id="FileSelectIE" type="application/x-itst-activex" style="border:0px;width:0px;height:0px;" 
classid="clsid:C584B594-D081-43E9-8989-01E8B1F8FCED" 
  codebase="FileOperation.CAB#version=1,0,0,1">         
  </object>

注:以上插件不支持64位操作系统。例:64位的windows 2003

How to Turn on ActiveX Controls in Firefox

 Save
Be the first!

ActiveX technology was developed by Microsoft in 1996 for sharing information and functionality among programs. ActiveX controls are browser plugins that provide additional functionality for Web browsers. Because of the security issues associated with ActiveX controls, they are not supported by default in most browsers including Mozilla Firefox. However, you can install them manually using an open source plugin for Firefox 39.

Warning

  • ActiveX controls possess known security risks. Spyware and adware can be downloaded disguised as ActiveX components. Be careful when you download ActiveX components and only use trusted sources.

Step 1

(Image: Image courtesy of Leeor Aharon)

Download the ActiveX plugin from the host page. This is an open source plugin that provides ActiveX support for Firefox. Find the download link and download the plugin.

Step 2

After the download is complete, close all open instances of Mozilla Firefox and run the setup, which installs the plugin on your computer.

Step 3

(Image: Image courtesy of Mozilla)

When the installation is complete, open Mozilla Firefox and tap the Menu icon at the top-right corner to open the main menu. Then click the Add-ons icon to open up the Add-ons screen. On the Add-ons page, locate the Plugins tab and click on it.

Step 4

(Image: Image courtesy of Firefox)

On the plugins page, locate the ActiveX Hosting for Firefox plugin. You may need to scroll down the list to find it. Select an activation method from the drop down menu on the right side of the screen. This determines how the plugin is initialized. Once an option is selected, the plugin is ready for use. Restart Firefox to complete the installation.

Warning

  • You should choose Ask to Activate to avoid accidental exposure to malicious ActiveX objects. Only choose Always Activate if you have been instructed to by an administrator in a secure environment.

让火狐浏览器可以访问含有activex控件网页的三种方式

一:安装一个扩展MediaWrap 0.1.7.3

mediawrap 是一个很小的 Firefox 扩展。它能够将 ActiveX 控件方式的网页内嵌媒体转换成 Firefox 能够支持的 Plugin 方式,从而使 Firefox 也能够象 IE 一样正常播放 WmplayerRmplayerQtPlayer  FlashPlayer 格式的媒体文件。当然,你的系统中首先要安装过相应的播放软件及解码器,比如,Windows Media Player  RealPlayer 等。

很多网站使用了ActiveX 控件方式来播放网页内嵌媒体,但是Firefox 浏览器本身并不支持ActiveX 控件。如果你经常在这样的网站观看视频或者听音乐,那么 mediawrap 扩展绝对是有用的。而且,mediawrap 不会给你带来任何安全问题。
下载安装地址:http://addons.sociz.com/firefox/116/

二:如果安装之后还不能观看,建议楼主安装一个IE Tab 让你可以直接在 Firefox 的标签页中以内嵌的 IE 引擎浏览网页。实现IE火狐双引擎。
下载安装地址:http://addons.sociz.com/firefox/53/

补充:这两个扩展最好都装上,这是使用火狐浏览器最常用的扩展,我就在用,很好一般的视频都可以播放,你安装的时候使用火狐上网,直接进网站安装即可。

三使用FireFox Mozilla Safari Opera 通用Activex Plugin 以下内容来自:http://www.microdraw.com/forum.php?mod=viewthread&tid=124

首先,Activex hosting pluginFireFox Mozilla Safari Opera 通用Activex Plugin 的原理都是是转换成Chrome/Firefox支持的NPAPI插件,包括Activex hosting plugin作者正在开发的火狐版Activex hosting plugin也是如此。

另外,Activex hosting plugin应该说是一款扩展,而FireFox Mozilla Safari Opera 通用Activex Plugin是一款Plugin,也就是插件。

FireFox Mozilla Safari Opera 通用Activex Plugin的前身是Mozilla官方发布的Mozilla ActiveX Plugin,由mozest论坛的king改进而来,官方版本会随着火狐的升级而失效(因为是扩展),而改进后的FireFox Mozilla Safari Opera 通用Activex Plugin,不依赖火狐的版本升级限制。

另外该款插件年代悠久,MS4.0版火狐上失效了。

注意:
1
、为了避免安全问题,请慎重打开对 Activex 控件的支持,除非你非常明确这样做的目的。
2
、这是一个插件(plugins),而不是扩展(Extensions)。安装后,你无法在扩展管理器中看到它。
想要检查是否安装成功,可以打开 Firefox,在地址栏输入“about:plugins”,看看有没有文件名:npActiveX.dllMozilla ActiveX control plugin support by moZine China之类的字样。有的话就是成功了,否则您可能得重新安装一次。

 

以下引用FireFox Mozilla Safari Opera 通用Activex Plugin发布页的原帖(下载页请到mozest):

首先感谢 水鑫日  sunwan为插件制作了安装程序
以前使用官方提供的Activex plugin总感觉有些别扭,因为随着FireFox的升级,plugin就得升级,曾经有一段时间简直有些望眼欲穿的感觉...所以下决心自己写个Activex Plugin出来!
这个plugin不依赖firefox的升级,尽量做到一劳永逸
 包里只有两个文件,展开后放在firefoxplugins目录,其中npActiveX.ini是配置文件,把允许的Activex控件的 CLSID写进去就可以了,默认已经把 Windows media player  real media player 设置好了,大家可以参照这个格式自己填写。
如果想完全开放对所有Activex控件的支持,就在文件的最开头打进一个
但强烈不建议这样做,开放所有Activex绝对不是件什么好事。
另:此插件不准备支持网上支付等Activex,也不对此进行测试,将来也不会支持。
下载时务必注意:1、使用 http://g.mozest.com访问本论坛;2、登录论坛;3、直接点击,使用浏览器下载,不要使用下载工具!
下载:
0.7.1.2

http://www.cnblogs.com/lidabo/p/3580643.html

Comments



Read more : http://www.ehow.com/how_5242435_turn-active-firefox.html
 
 
  
  
  
  

之前在一个B/S项目中遇到一个需求,就是客户需要在页面上对报表的布局以及显示内容,进行自定义。最后决定使用activex技术来实现。众所周知,activex是微软搞得,因此只有ie内核的浏览器才能支持。像firefox(火狐)、Chrome、Apple Safari等非ie内核浏览器都不支持activex控件,这样就大大加大了系统使用的局限性。 因此考虑是不是可以让非ie内核浏览器也能支持activex控件,目前火狐等浏览器也有类似于activex控件的技术,那就是插件。所以最终决定以插件来作为连接activex的纽带,使非ie内核浏览器也可以支持activex控件。 确定了开发内容后,接下来就是上网了解相关方面的知识和技术。了解了NPAPI技术 NPAPI全称为:Netscape Plugin Application Programming Interface (NPAPI). NPAPI 是一个很经典的插件方案,用dll进行注入,用协定的API进行通信,用字符串描述插件能力。浏览器会根据能力描述,动态加载插件,并负责插件调用的流程和生命周期管理。而插件中,负责真实逻辑的处理,并可以构造UI与用户交流。以此类方式实现的插件系统。 在firefox提供SDK的下载(https://developer.mozilla.org/en-US/docs/Gecko_SDK) 插件整体的实现思路就是通过插件调用OCX控件,也就是插件本身是衔接浏览器与OCX的一条桥梁,这样做就可以简单的实现非ie内核浏览器对OCX控件的支持。 经过一个多礼拜的开发,插件功能已经基本实现。并且为了方便使用已经打包成exe安装包。在项目中可以直接让用户下载安装。 安装效果图:

 

安装完成后,可以打开火狐浏览器在地址栏输入about:plugins,查看插件是否正确安装,
如下图所示,已经安装成功
下面测试一下插件效果,首先找一个可用的activex控件(本人用自己写的插件测试)html页面代码
 
  1. <HTML>    
  2. <H1> 测试页面 </H1><p>    
  3. 测试页面    
  4. <HR><center><P>    
  5. <br>    
  6.     <object    
  7.         id="Webplugin"    //ocxid    
  8.         TYPE="application/xhanhan-activex"      
  9.         BORDER="0"    
  10.         WIDTH="300"    
  11.         HEIGHT="300"    
  12.         clsid="{A2DC9F0E-1A2D-4C6D-BB2E-053BABE17134}"> //ocx插件id    
  13.     </object>    
  14.     
  15. </HTML>    
 
以上代码保存为html文件然后用火狐打开,效果如下图
 
 
可以看到activx控件已经可以在火狐下运行。目前插件已经在xp,vista、win7、win7(64)、windows server2003、
windows server2008等操作系统,以及火狐、Google Chrome、Opera、Apple Safari、遨游极速模式、360急速模
式下通过测试。支持市面上大部分主流浏览器。
 
参考源码:http://code.google.com/p/ff-activex-host/source/checkout
分类:  com/ATL/Activex
2
0
(请您对文章做出评价)
« 上一篇: OCX控件在IE中无法侦测到键盘消息( MFC ActiveX Control in IE Doesn't

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值