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
1 answer

Get a list of fonts in a Firefox extension

In a Firefox extension of mine, the preferences window apparently broke somewhere after Firefox 2.0, and (a part of) the problem lies in the following line: var fontList = Components.classes["@mozilla.org/gfx/fontlist;1"]. …
Kalle
  • 13,186
  • 7
  • 61
  • 76
2
votes
1 answer

xul/xpcom copy image from string to clipboard

I'm stuck with no clues how to copy image to clipboard. My code looks like this: var image = "data:image/png;base64,..." var io = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); var…
nweb
  • 151
  • 1
  • 10
2
votes
3 answers

Using a plugin generated with Firebreath in a Firefox Extension?

Is it possible to use a .dll made with Firebreath in a Firefox extension? Currently, I am trying to port an extension I made for Google Chrome that uses javascript to get the HTML of the document, and then calls a function from the .dll and passes…
Ivan
  • 10,052
  • 12
  • 47
  • 78
2
votes
1 answer

Accessing Firefox cache from an XPCOM component

Does anybody know how to get local path of file cached by Firefox based on its URL from an XPCOM component?
Mladen Janković
  • 7,867
  • 3
  • 22
  • 26
2
votes
3 answers

Problems Registering XPCOM component

I'm working on my first XPCOM component. Unfortunately, I can't register it successfully. Building is ok. Here's the makefile CXX = g++ CPPFLAGS += -fno-rtti \ -fexceptions \ -shared \ -fshort-wchar # Change this…
liangzan
  • 6,804
  • 4
  • 29
  • 28
2
votes
2 answers

How to HTML encode a string in JavaScript from a Firefox extension

So I know I can write my own HTML-encoding function like this: function getHTMLEncode(t) { return t.toString().replace(/&/g,"&").replace(/"/g,""").replace(//g,">"); } But I was wondering if there were any…
bhollis
  • 4,624
  • 2
  • 28
  • 32
2
votes
1 answer

URL filtering with Firefox add-on

During the page load there are number of HTTP requests for document itself and its requisites. How do i hook them, retrieve target URL and prevent request from being sent if certain condition met? Plug-ins can also issue HTTP requests, i would like…
user422039
  • 1,447
  • 4
  • 13
  • 28
2
votes
0 answers

How to use XPCOM in iMacros to load data and write data

These are the functions which load file and write file. I used JavaScript and XPCOM for these operations. You can use these functions in iMacros JavaScript file. Edit: These functions work best in iMacros version 8.9.7 and corresponding Firefox. The…
edinvnode
  • 3,497
  • 7
  • 30
  • 53
2
votes
2 answers

Can you check if an object is wrapped by XPConnect (Firefox)?

My scenario: I am iterating over the window object and trying to retrieve only user-defined variables/functions and filtering out native browser objects. for(var i in window) { // Right now I just have a bunch of if checks on window[i] } I…
treaint
  • 699
  • 1
  • 8
  • 13
2
votes
3 answers

NS_ERROR_FAILURE with absent property

I trying to capture pageLoad event in progressListener, in onLocationChange i check URI of fresh page, and in case URI = about:blank i got Error: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIURI.host] As i understand this URI…
2
votes
0 answers

Legacy extension not loading on thunderbird-59

i'm trying to follow https://wiki.mozilla.org/Thunderbird/Add-ons_Guide_57#Removed_interfaces_in_mozilla57 to upgrade our extension to work a little bit longer. I'm testing with thunderbird 59.0.b2 and after not being able to refresh the source, i…
2
votes
2 answers

Last inserted id from SQLite in FireFox add-on

im writing addon for firefox and use SQLite trough XPCOM. Can anyone explain how to get last inserted id from autoincrement column?
2
votes
2 answers

Chrome and XPCOM

Вoes Chrome have an equivalent to XPCOM?
Skizit
  • 43,506
  • 91
  • 209
  • 269
2
votes
1 answer

How to get the page element initiating a GET request from inside a firefox extension xpcom component?

I have a firefox extension xpcom component that listens to http-on-modify-request and gets the location of the page making the request: getLocationOfOriginatingWindow: function (httpChannel) { try { var notificationCallbacks; …
Anthony Bak
  • 1,123
  • 3
  • 10
  • 16
2
votes
1 answer

What is missing that I get an NS_BASE_STREAM_CLOSED error?

I just recently joined a website project. In order to work on it, I cloned the git repo and set up a fresh LEMP stack on a VPS to serve the page. It took a surprising amount of work to get the thing running (my first attempt had been on a laptop on…
pyansharp
  • 301
  • 3
  • 9