I am feeling overwhelmed by so many different approaches, guides, and yet none I tried work for me. Please connect at least some of the dots for me...
My objective is to find a window object in background script of Firefox WebExtension.
Problem, I cannot import Services
library to use it for finding a window
object.
Two methods I tried:
Components.utils.import("resource://gre/modules/Services.jsm");
Gives a warning thatComponents
is depricated, and an error:Components.utils
is undefined.const { Cu } = require("chrome"); let Services = Cu.import("resource://gre/modules/Services.jsm");
Throws an error thatrequire
is undefined.
That is a background script, point me to the right direction how to import the proper libraries/interfaces I need to work with?