Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does my simple Firefox extension now refuse to run?

It pains me to ask such a basic question, but I'm at my wits' end.

Situation

  • I'm working on a 32-bit Windows 7 machine, running Firefox 34.0.5.

  • I have a trivial Firefox extension in directory C:\Projects\CloudGem\plugin.
    The file structure is as follows:

    CloudGem directory structure

  • All other plugins, excepting some FF developer plugins, are disabled.

  • All files are confirmed UTF-8 encoded.

File Contents

The contents of both instances of cloudgem.js are:

window.addEventListener( "load", function() {
    setInterval( function() {
        console.log( "Cloudgem service started (2)." );
    }, 2000 );
}, false );

console.log( "Cloudgem service started (1)." );

The contents of cloudgem.xul are:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE overlay>

<overlay id="cgem-scriptmount" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    <script type="application/x-javascript" src="cloudgem.js" />
</overlay>

The contents of chrome.manifest are:

# Content definitions.

content      cloudgem      chrome/content/


# Overlays.

overlay chrome://browser/content/browser.xul chrome://cloudgem/content/cloudgem.xul

The contents of install.rdf are:

<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
    <Description about="urn:mozilla:install-manifest">
        <em:id>[email protected]</em:id>
        <em:version>1.0</em:version>
        <em:type>2</em:type>

        <!-- Target application this extension can install into, with minimum and maximum supported versions. -->
        <em:targetApplication>
            <Description>
                <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
                <em:minVersion>1.5</em:minVersion>
                <em:maxVersion>34.0.*</em:maxVersion>
            </Description>
        </em:targetApplication>

        <!-- Front end metadata. -->
        <em:name>CloudGem</em:name>
        <em:description>A description of GloudGem.</em:description>
        <em:creator>Me</em:creator>
        <em:homepageURL>http://cloudgem.net/</em:homepageURL>
    </Description>
</RDF>

The contents of [email protected] are:

C:\Projects\CloudGem\plugin\

A duplicate copy of this file exists in the extensions folder of my Firefox developer profile.

What Happens

  • Firefox appears to load the extension without issue. It appears in the list of active plugins. All the metadata is correct.

  • Running chrome://cloudgem/content/cloudgem.xul in the address bar runs the script as expected, generating messages on the console.

  • Roughly a month ago I created another extension with virtually identical structure. It loaded and the scripts executed as expected.

  • The problem now is that the code will not run. >____< When Firefox starts up, it does absolutely nothing. No errors. No messages on the console. It just sits there like a dumb fox, not running my code. Moreover, my previous extensions that worked as of a month ago have also inexplicably stopped running at startup.

What I've Already Tried

  • Creating a brand new developer profile and installing the plugin there. Same result.

  • Changing the console output calls to dump() calls, throwing exceptions, changing the window title, etc. Same result.

  • Changing the names of the files. Same result.

  • Migrating to a different machine (this time running Windows XP). Same result.

  • Duplicating the cloudgem.js code in the components folder and running it as script in a XUL overlay. This is a hack, in response to the fact that FF wasn't running the code in the components folder. Neither instance of the code runs.

As I say, I'm completely out of ideas. I have no idea why this isn't running at browser startup. The only changes on my system between now and a month ago when the code worked is some routine updates to my OS, Firefox, and virus checker. Disabling the "web shield" of my virus checker (Avast) doesn't remedy the problem, and the virus checker isn't making any discernible noise about the plugin.

Can anyone suggest a solution? I've run up and down the MDN articles and found nothing.

Much thanks in advance.

like image 771
COTO Avatar asked Nov 09 '22 20:11

COTO


1 Answers

I think you may be looking at a wrong console. Add-ons output information to the Browser Console.The more general question is how to see output on the Browser Console.

It's not so obvious, but you can do it following these two steps.

1) In the location bar type in about:config, and look for loop.debug.loglevel, change the value to all to be sure all output is logged.

Step1

You may need to restart your browser.

2) Open Browser Console, by either Ctrl+Shift+j or Hamburger Menu -> Developer -> Browser Console.

Developer Console

The messages should be printed there.

Messages

like image 80
lpiepiora Avatar answered Nov 14 '22 22:11

lpiepiora