chome.extension.getURL returns "url is not defined"

RESOLVED DUPLICATE of bug 1199473

Status

RESOLVED DUPLICATE of bug 1199473
3 years ago
3 months ago

People

(Reporter: warsaalk, Unassigned)

Tracking

42 Branch
x86_64
Windows 10

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.52 Safari/537.36

Steps to reproduce:

Hi,

I'm testing my Chrome extension in Firefox 42.0b3 which has WebExtensions.
I updated the manifest to match the supported properties from this page:
https://wiki.mozilla.org/WebExtensions#Testing_out_the_WebExtensions_API

I'm trying to set the default path for my web_accessible_resources by using the following line in my content_scripts file:
contentPath : chrome.extension.getURL('chrome/content/')

Grtz,
Klaas



Actual results:

When the extension is launched it returns this error:
ReferenceError: url is not defined => ExtensionContent.jsm:86:7

It seems that the resolve method is trying to use a url variable which doesn't exist.
I guess it should be using the actual function parameter "path", as defined in getURL.

Code:
extension: {
  getURL: function(path) {
    return context.extension.baseURI.resolve(url);
  },

  inIncognitoContext: PrivateBrowsingUtils.isContentWindowPrivate(context.contentWindow),
}


Expected results:

This function should return the url from which I can access my web_accessible_resources defined in the manifest.json.
Google Chrome returns: chrome-extension://ipmfkhoihjbbohnfecpmhekhippaplnh/chrome/content/
(Reporter)

Updated

3 years ago
OS: Unspecified → Windows 10
Hardware: Unspecified → x86_64
This was only fixed in Firefox 44, which is currently Firefox Nightly. We currently suggest that people testing WebExtension should always use Nightly.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1199473

Updated

3 months ago
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.