问题标签 [xpcom]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
firefox-addon - Firefox 弹出窗口事件
我正在使用 XPCOM C++ 编写一个 Firefox 扩展。
我想在弹出窗口(就像我们在浏览 www.rediffmail.com 时看到的那样)打开时收到通知。
我如何捕捉这个事件?有人知道怎么做吗?
谢谢你的帮助。
javascript - Create Firefox Addon to Watch and modify XHR requests & reponses
Update: I guess the subject gave a wrong notion that I'm looking for an existing addon. This is a custom problem and I do NOT want an existing solution.
I wish to WRITE (or more appropriately, modify and existing) Addon.
Here's my requirement:
- I want my addon to work for a particular site only
- The data on the pages are encoded using a 2 way hash
- A good deal of info is loaded by XHR requests, and sometimes displayed in animated bubbles etc.
The current version of my addon parses the page via XPath expressions, decodes the data, and replaces them
The issue comes in with those bubblified boxes that are displayed on mouse-over event
- Thus, I realized that it might be a good idea to create an XHR bridge that could listen to all the data and decode/encode on the fly
- After a couple of searches, I came across nsITraceableInterface[1][2][3]
Just wanted to know if I am on the correct path. If "yes", then kindly provide any extra pointers and suggestions that may be appropriate; and if "No", then.. well, please help with correct pointers :)
Thanks,
Bipin.
[1]. https://developer.mozilla.org/en/NsITraceableChannel
[2]. http://www.softwareishard.com/blog/firebug/nsitraceablechannel-intercept-http-traffic/
[3]. http://www.ashita.org/howto-xhr-listening-by-a-firefox-addon/
javascript - Android webkit 浏览器中的 XPCOM 支持?
Android WebKit是否像 Firefox 一样支持XPCOM框架或NPRuntime API?如何在Android WebKit 插件中实现JavaScript?
更新:我正在为 Android WebKit 浏览器编写一个媒体播放器插件,我的插件需要通过 JavaScript 从网页获取命令(播放/暂停/停止/调整大小等一些操作作为 JavaScript 命令从浏览器)。我的插件是用原生 C 代码编写的。是否有可用于 JavaScript 通信的示例或示例插件?
javascript - How to make use of c++ xpcom component from javascript xpcom component
I have developed a xpcom component using c++. I have GetHWND() method in my component. I have also developed another xpcom component using javascript. I want to make use of GetHWND function in javascript xpcom component. I am using following code to do so.
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var myComponent = Components.classes['@dougt/WebLock'].createInstance(Components.interfaces.IWebLock);
myComponent = myComponent.QueryInterface(Components.interfaces.IWebLock);
var res = myComponent.GetHWND(mainWindow.content.document);
But it is giving error as "ReferenceError: netscape is not defined". I did google search but did not find the solution to it.
I am using Mozilla Firefox and I want it to get worked for the same.
Please help me to come out of this problem. Thanks in advance.
python - virtualbox 和 python API
0 票否决
我已经安装了 virtualbox 。但我无法导入模块 xpcom。但突触包显示它已安装。有什么问题?
-问
xpcom - Firefox 3.6 中的 Components.interfaces.nsIProcess2 —— 它去哪儿了?
我正在测试一个包含 Firefox 扩展作为一个组件的应用程序。它最初是在 FF3.5.5 是最新版本时部署的,并且在 3.5.6 和 3.5.7 中幸存下来。但是在 FF3.6 上,我在错误控制台中得到以下信息:
抛出错误的函数是:
正如你所看到的,这个函数所做的只是运行一个带有一些命令行参数的外部 EXE 帮助文件(由注册表项定位),并设置一个观察者来异步等待响应并处理退出代码。
违规行暗示FF3.6 中不再定义 Components.interfaces.nsIProcess2 。它去哪儿了?我在 Mozilla 文档中找不到任何表明它在最新版本中已更改的内容。
c++ - XPCOM Shockwave Flash C++
I recently started "playing" with xpcom, and I would like to know if there is a way do interact with a Shockwave flash element.
In IE I can use the IShockwaveFlash interface, but for the Firefox I can't find any interface.
I tried using the nsIFlash5 definition from the header file "wrap_XPCOM_3rdparty.h" (acquired from the XulRunner-1.9 source code link ) and I can sucessfuly query a nsIDOMHTMLEmbedElement for the nsIFlash5 interface, but I'm unable to use any of the functions, since it "crashes".
Thanks.
xul - 如何在 XPCOM 组件中实现定时器?
我正在创建一个基于 XULRunner 的 GStreamer 应用程序。为了实现这一点,创建了一个 XPCOM 组件,它使某些 GStreamer 功能在 XUL 应用程序中可用。然而,GStreamer 通常使用一个消息循环(GMainLoop),它使人们能够接收总线消息。因为 XULRunner 已经有自己的消息循环,所以我无法创建 GMainLoop。所以我需要另一种方式来获取这些消息。一种方法是使用 gst_bus_poll 调用。我需要经常调用它以防止消息队列被淹没。所以我认为计时器是正确的解决方案。
长话短说:如何在 XPCOM 组件中创建计时器?
javascript - 在 Firefox 启动时设置首选项
提前感谢大家-
我需要在启动时加载任何窗口之前加载首选项。下面是我一直在使用的一些 /component 代码。SetPreference 方法在被调用时似乎失败了(也没有执行任何后续操作) - 我假设是因为它需要的资源在执行时不可用......或者我做错了什么。对此代码或其他在启动时设置首选项的方法有什么建议吗?
再次感谢,
山姆
由于某种原因,SO 的代码格式无法正常工作 - 这里也是代码的链接 - http://samingrassia.com/_FILES/startup.js
c++ - 我可以像在 IE 中使用 win32 COM 一样使用 XPCOM 创建和操作 Firefox 窗口吗?
使用 win32 COM,我创建了一个 Internet Explorer 实例并几乎完全通过我的 python 代码控制它(操作窗口、DOM 元素等)。更具体地说,使用 DispatchEx('InternetExplorer.Application')。我可以使用 XPCOM 和 C++/python 做同样的事情吗?
我需要自动化在某些网站的 html ui 上执行的某些操作,所以不,我不能使用 urllib 也不能使用 selenium,因为它不适用于跨域 url。我为 Internet Explorer 编写了一个包装类,我可以在其中创建一个浏览器窗口并用它做任何事情,但我也想用 firefox 做同样的事情。我考虑过创建一个 XUL 应用程序,该应用程序通过用 XUL/js 编写的 tcp 服务器公开 DOM 功能。我什至不确定这是否可能,但如果我可以从我的 python 代码中完成所有操作,而无需在外部运行 xulrunner,那就更好了。