Frequent Use Of content.URL In Contentscript Injected Into Facebook Causes Undefined Error In content-proxy.js line null When Loggin In Or Off- SDK Only

RESOLVED WORKSFORME

Status

Add-on SDK
General
RESOLVED WORKSFORME
6 years ago
6 years ago

People

(Reporter: simonrothe, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Ubuntu/12.04 Chromium/18.0.1025.151 Chrome/18.0.1025.151 Safari/535.19

Steps to reproduce:

I run a firefox extension with the following main.js:

exports.main = function() {
    var data = require("self").data;
    
    var pageMod = require('page-mod').PageMod({
        include: ["*.facebook.com"],
        contentScriptFile: data.url("cs.js"),
        contentScriptWhen: "start"
    });
};

and cs.js in /data:


function _object() {
	activ = window.setInterval(checkForChanges, 200);

	function checkForChanges() {
		console.log(typeof(document) + " " + typeof(document.URL) + " " + document.URL);
	}

}

if (window.frameElement === null) {
    var object = new _object();
}

For this I used the SDK 1.7 on my computer Ubuntu 12.4 with Firefox 13.0

I opend facebook, logged in, went to privacy, settings logged off.


Actual results:

The following error was thrown to my Terminal where I executed cfx run:

error: An exception occurred.Traceback (most recent call last):File "resource://jid1-shkhsivnqgontq-at-jetpack/api-utils/data/content-proxy.js", line undefined, in null

Some of my following add-on script refuses to work proberly.


Expected results:

The error should not occur like it does when I build an xpi file or use the online builder and therfore use the firefox build in error console instead of the Ubuntu Terminal.
Can you try using cfx run with the --profiledir flag, and pass it to your existing profile?
https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/cfx-tool.html#profiledir
Whiteboard: [triage:followup]
Feel free to reopen if you can reproduce this in a current SDK version.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → WORKSFORME

Updated

6 years ago
Whiteboard: [triage:followup]
You need to log in before you can comment on or make changes to this bug.