Exception "Component does not have requested interface" (mobile)

RESOLVED INCOMPLETE

Status

Add-on SDK
General
RESOLVED INCOMPLETE
3 years ago
4 months ago

People

(Reporter: Thomas Andersen, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:35.0) Gecko/20100101 Firefox/35.0
Build ID: 20141128004001

Steps to reproduce:

1. Create a new add-on using cfx init
2. Put the code (see below) in lib/main.js
3. Run the cfx command (see below).
4. Navigate to any page.

System: Android/Firefox 34
SDK Git branch: firefox34
Command: cfx run -a fennec-on-device -b adb --mobile-app firefox --force-mobile
Log: adb logcat | console

lib/main.js code:

var data = require('sdk/self').data;
var pageMod = require('sdk/page-mod');

pageMod.PageMod({
  include: '*',
  contentScriptWhen: 'ready',
  attachTo: 'top',
  contentScriptFile: data.url('mod.js'),
  contentStyleFile: data.url('mod.css')
});

(my data/mod.js file is empty)



Actual results:

When running the addon and navigating to any page I get this error in adb logcat:

E/GeckoConsole(23750): [JavaScript Error: "[Exception... "Component does not have requested interface"  nsresult: "0x80004002 (NS_NOINTERFACE)"  location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///storage/emulated/legacy/jetpack-profile/extensions/jid1-401NAesIVVcWXQ@jetpack.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/tabs/utils.js :: isFennecTab :: line 42"  data: no]"]

And my page mod script is not executed as expected.



Expected results:

The page mod script should be loaded and exectued.

This worked as expected when using Android/Firefox 33
(Reporter)

Comment 1

3 years ago
For me, it seems like contentStyleFile: data.url('mod.css') is causing the exception.

Comment 2

3 years ago
I have the same issue (and also did not in Fennec 33). Removing the content style file "solved" it for me as well.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Looks like this line of code is the culprit:

>  tab.QueryInterface(Ci.nsIBrowserTab) === tab;

Comment 4

3 years ago
This bug seems to be causing the following issue:
https://github.com/kevincox/youtube-e2l/issues/10
Priority: -- → P1

Comment 5

3 years ago
This bug is causing the following issue as well: https://github.com/pratikabu/scrolltotop/issues/35

Comment 6

3 years ago
Does still reproduce on Firefox 40? Because bug 1167764 which is similar doesn't anymore.

Updated

2 years ago
Priority: P1 → --
https://bugzilla.mozilla.org/show_bug.cgi?id=1399562
Status: NEW → RESOLVED
Last Resolved: 4 months ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.