Questions tagged [xpcom]

XPCOM (Cross Platform Component Object Model) is a cross-platform component model from Mozilla. It is similar to Microsoft COM and CORBA.

XPCOM (Cross Platform Component Object Model) is a cross-platform component model from Mozilla. It is similar to Microsoft COM and CORBA.

It has multiple language bindings, allowing XPCOM components to be used and implemented in JavaScript, Java, and Python in addition to C++. Interfaces in XPCOM are defined in a dialect of IDL called XPIDL.

409 questions
2
votes
2 answers

XPCOM: sniff HTTP responses

I would like to write a little component with XPCOM that can sniff all HTTP responses received by the browser. Right now the only examples that I can find (like the one appended below) only allow me to retrieve the response for a request that I fire…
some dude
  • 146
  • 2
  • 9
2
votes
1 answer

Porting mozilla's NSModule to Delphi

In extension to this question, I guess I'll best show what I've got so far. What I'm trying to do is create a Firefox extension with Delphi, that'll work with the Firefox versions of the future that will use an exported NSModule structure, and no…
Stijn Sanders
  • 35,982
  • 11
  • 45
  • 67
2
votes
2 answers

How to preprocess HTML before it's loaded and parsed by Mozilla?

I need a way to process HTML before it's actually loaded and parsed by Mozilla. Is there any content listener that I can use in my Firefox extension?
Michael Spector
  • 36,723
  • 6
  • 60
  • 88
2
votes
0 answers

Get URL from nsIWebProgress STATE_REDIRECTING

I am looking for a simple solution to catch any window re-directions (301, 302 etc.) to retrieve the corresponding url from a nsiWebProgress. Current solution Right now, I am using the nsIWebProgress.NOTIFY_STATE_DOCUMENT event listener, processing…
mate64
  • 9,876
  • 17
  • 64
  • 96
2
votes
1 answer

How to access nsIHTMLEditor interface in GeckoFX?

I am trying to make a WYSIWYG HTML-editor by embedding GeckoFX in a Windows Forms application in VB.NET. The code goes like this: Dim Gbrowser As New…
GreenBear
  • 373
  • 1
  • 6
  • 18
2
votes
2 answers

Firefox XPCOM addon: "unexpected error" for xslt transform

I'm trying to update/refactor a legacy Firefox extension that makes extensive use of the XPCOM API. We do a lot of XSLT transforms and client-side file IO for a specialized application. I keep getting strange errors, though, when processing XSLT…
Sabrina S
  • 337
  • 8
  • 21
2
votes
1 answer

Using sockets (nsIServerSocket) in XPCOM component (Firefox Extension) (sockets + new window = seg faults)

PLEASE READ THE UPDATE #2 BELOW IF YOU ARE INTERESTED IN THIS PROBLEM ;) Say I put this code into the JS of my extension. var reader = { onInputStreamReady : function(input) { var sin = Cc["@mozilla.org/scriptableinputstream;1"] …
Karolis
  • 2,899
  • 2
  • 23
  • 38
2
votes
0 answers

Control Firefox application from another c++ program using xpcom

So far, all xpcom examples I saw are Firefox addons. You write some C++ code, build, and register it. This resembles Microsoft COM in-process server, but instead of Windows registry the component information is stored in Firefox profile. Does…
basin
  • 3,949
  • 2
  • 27
  • 63
2
votes
0 answers

XPCOM component that extends nsIContentPolicy

For testing purposes I'm trying to block images using an XPCOM component, but the shouldLoad method is only called for internal resources (e.g. chrome://global/skin/global.css, chrome://browser/skin/tabbrowser/xxx.png, about:blank, etc...), it is…
Maxime
  • 93
  • 5
2
votes
1 answer

Compilation of firefox extension with xulrunner-sdk-36.0 C++

I have a FF toolbar working in all previous versions. My toolbar partially written in C++. I've tried to build the C++ part with a new xulrunner-sdk-36.0 I've receive such link errors: 1>xpcomglue_s.lib(nsISupportsImpl.obj) : error LNK2038:…
AGDev
  • 33
  • 7
2
votes
2 answers

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(){ //…
bosky101
  • 2,244
  • 1
  • 18
  • 10
2
votes
1 answer

Getting URI from nsIDOMEvent

I'm using XPCOM, and I want to get the URI of the portion of a page the user clicks (e.g., a user right-clicks on a frame, and I want to display the URL of that frame). So I've set up a mouse listener (nsIDOMEventListener) and then when a click…
Dan
  • 61
  • 4
2
votes
0 answers

Xulrunner Browser Posting data via loadURI()

I have XULrunner opening a browser window that loads a XUL page from my local server. I am trying to post some data back to my PHP but with little success. I am just using the example at…
Krik
  • 445
  • 5
  • 15
2
votes
0 answers

How to compile and "register" an XPCOM component with latest Gecko SDK in Windows?

I'm trying to follow this tutorial with the latest Gecko SDK(at this moment, the latest version is xulrunner-sdk 31.0). And I'd like to do it with Visual Studio 10 in a separate location. Right now, I managed to get the code compiled though I'm not…
wxz
  • 41
  • 3
2
votes
5 answers

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_am_jorf
  • 53,608
  • 15
  • 131
  • 222