I'm using add on builder to build extensions when searching MDN I find interfaces that I can't figure how to call them in online addon builder
for example this code
var bmsvc = Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"]
.getService(Components.interfaces.nsINavBookmarksService);
doesn't build and results in XPI error
On the top of your document put line:
const { Cc, Ci, Cu } = require('chrome');
and instead of Components.classes
try using Cc
, instead of Components.interfaces
try Ci
.
var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"]
.getService(Ci.nsINavBookmarksService);
This should work, if not, put link to your public addon or sample of code and link to documentation site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With