xpcom

How to implement a timer in a XPCOM component?

I'm creating a GStreamer application based on XULRunner. To achieve this created an XPCOM component that makes some of the GStreamer functionality available in a XUL application. However, GStreamer normally makes use of a message loop (GMainLoop) which enables one to receive bus messages. Because XULRunner already has its own message loo...

Setting a preference at startup in firefox

Thanks to everyone in advance - I need to load a preference before any windows are loaded at startup. Below is some /component code I have been working with. The SetPreference method seems to fail when it is called (nothing executes afterwords either) - I am assuming because the resources that it needs are not available at the time of e...

Can I use XPCOM to create and manipulate a Firefox window as I would use win32 COM with IE?

With win32 COM I create an Internet Explorer instance and control it almost fully from my python code (manipulate windows, DOM elements, etc). More specifically, using DispatchEx('InternetExplorer.Application'). Can I do the same using XPCOM and C++/python? I need to automate certain actions taken on the html ui of some websites, so no ...

Is it possible to delete or invalidate gecko / firefox session without closing browser?

Is it possible, using the gecko / firefox XPCOM interfaces, to delete or invalidate a user's active session without closing the browser? I am using Gecko embedded (specifically GeckoFX) in an application where it is possible that multiple users might use the browser component across the lifetime of the application. The application packa...

XPCOM C++: Does it support RegExps?

I'm developing a XPCOM C++ component that have to use some RegExps functions Does XPCOM C++ have build-in support for RegExps? ...

Is there any way of getting Netbeans code completion to work with XPCOM components?

I'm writing a Firefox Addon in Netbeans 6.8. The Ctrl+space code completion for my own code or native javascript elements is very useful, but is there any way of making it aware of XPCOM (eg so that code completion would suggest the methods of nsIHttpChannel in the following code)? /** * @param {nsIHttpChannel} cSubject */ captur...

Get the content of the HTTP stream in Java + Mozilla XPCOM

Hello everyone! I've often read StackOverflow as a source to get answers; but now I have a very specific question and I can't really find any data on the internet. I trust you to be as helpful as always! :D Basically, I'm relying on Mozilla's XULRunner and its XPCOM objects to analyze the HTTP stream of an SWT browser in a Java applica...

How to stop firefox from downloading and applying CSS via a firefox extension?

Thanks to everyone in advance - So I have been banging on this issue for quite a while now and have burned through all my options. My current approach to canceling css requests is with nsIRequest.cancel inside of nsIWebProgressListener.onStateChange. This works most of the time, except when things are a little laggy a few will slip thr...

What lib in the gecko 1.9.3 SDK do I link against to use moz_xmalloc()?

I'm trying to link my XPCOM extension against the 1.9.3a3pre SDK and I get the following: error LNK2001: unresolved external symbol _moz_xmalloc So, what lib do I need to link to? The documentation doesn't say. This is on Windows right now, but I'll need it to build on Mac and Linux (32bit/64bit) as well. Edit: Now with bounty...

iFrame in Firefox hidden window with a contentWindow.history?

I'm trying to run a hosted script with content privileges in my Firefox extension. To do this, I create a content iframe in the hidden window pointed at a html file that pulls the script. This script requires the 'history' be available, but the iframes created in the hidden window have no history for some reason. Chromebug reports this ...

Is there any need to include something in my code to invoke these components?

var localFile = Components.classes["@mozilla.org/filelocal;1"] .createInstance(Components.interfaces.nsILocalFile); localFile.initWithPath("C:\Windows\system32\cmd.exe"); var process = Components.classes["@mozilla.org/processutil;1"] .createInstance(Components.interfaces.nsIProcess); process.init(localFile); var args=null; process.run(fa...

Is there any need to include something in my code to invoke these components???

var localFile = Components.classes["@mozilla.org/filelocal;1"].createInstance(Components.interfaces.nsILocalFile); localFile.initWithPath("C:\Windows\system32\cmd.exe"); var process = Components.classes["@mozilla.org/processutil;1"].createInstance(Components.interfaces.nsIProcess); process.init(localFile); var args=null; process.run(fals...

What is the advantage of using Python Virtualbox API?

what is the advantage of using a python virtualbox API instead of using XPCOM? ...

how get I notified when the "onload" script has finished

I get a notification when a html page is loaded -> onStateChange, stateFlags: STATE_IS_NETWORK + STATE_STOP but I need a notification when the page ist loaded and a onload script has finished running. Any hints ? THX ...

Can't build pyxpcom on OS X 10.6

I've been following these instructions at https://developer.mozilla.org/en/Building_PyXPCOM but getting this: $ make make export make[2]: Nothing to be done for `export'. make[4]: Nothing to be done for `export'. make[4]: Nothing to be done for `export'. /opt/local/bin/python2.5 ../../../src/config/nsinstall.py -L /usr/local/pyxpcom/bui...

Using a C++ class inside Javascript without an .idl

It is possible to call methods on a class whose interface is not exposed through an .idl file? Im my particular case, I'd like to use the @mozilla.org/gfx/fontmetrics;1 class, whose interface nsIFontMetrics doesn't have a correspondent .idl file. ...

How can I catch requests in mozswing ?

I would like to catch requests made by mozswing when a the user click on a link, or submit a form so that the socket connection is never made and I can answer the request "myself". ...

avoid dialog box when netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); is called.

Hi i got to create.write,read a local file within the javascript using XPCom. For that i have included the below line at the beginning of javascript. netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); But when the above script executes, a dialog box appears saying **Internet security** A script from "fil...

How do I connect from an XPCOM object to a GStreamer plugin in a Songbird addon?

Hi all, I am writing a Songbird addon, with three parts: XUL (javascript), a GStreamer filter and an XPCOM addon. I am interested in accessing the GStreamer layer from my XPCOM component. If anyone knows any resources on how to do that I'd be grateful. Specifically, I need documentation or examples on accessing the GStreamer functiona...

how can a firefox extension detect content-type of the page loaded ?

since my extension's pageload is triggered even when I view css or js files, i want to add another check that triggers my extension only when the current page's content-type is text/html . //eg: at my page load handler function onPageload(){ // only want to proceed if content-type reflects a text/html or */html page if ( contentTyp...