-1

I'm trying to get Justin D-Arcangelo's dns-sd.js (https://github.com/justindarc/dns-sd.js) Javascript code to work in a web extension for Firefox 51.0.1 (Ubuntu 14.04)

I have the following manifest.json file:


{
  "name": "discover",
  "version": "1.0",

  "description": "Discovers Bonjour/Avahi based services",

  "developer": {
  },
  "type": "privileged",
  "permissions": {
    "udp-socket": {}
  },
 "browser_action": {
    "default_icon": "icons/border-48.png",
    "default_title": "Discovery",
    "default_popup": "popup/discover.html"
  },

  "icons": {
    "48": "icons/border-48.png"
  }

} 

As recommended by the author referred to above, I have the following in the manifest.json file:

"type": "privileged",
"permissions": {
    "udp-socket": {}
},

Unfortunately, when I attempt to load this manifest file in Firefox's add-on test page under 'about:debugging'. it complains that

"There was an error during installation: permissions is not iterable".

From what I see here, the permissions are represented in an array i.e. ["x","y",etc.]
How do I reconcile these two different usages? What is the correct way of setting the udp_socket permission in my manifest.json?

Cache Staheli
  • 3,510
  • 7
  • 32
  • 51
  • WebExtensions are **far** less capable than other types of extensions. What is possible in a WebExtension is a small subset of what you can do in any other type of Firefox extension. You will need to completely rework how the code you have linked works. Where did the author of that extension make the recommendation to put those in your *manifest.json*? Where did that author, or you, get the idea that WebExtensions have access to UDP sockets? – Makyen Feb 25 '17 at 20:41

1 Answers1

0

The code linked in my question was meant to be part of a Firefox OS application. I tried to use it in a WebExtension; this was my mistake. As per the page at https://bugzilla.mozilla.org/show_bug.cgi?id=1247628, there seems to be, as yet, no support for UDPsocket in Firefox Web Extensions. Thanks to Makyen for his/her inputs.