I'm trying to write an extension using polyfills and I found a sample extension which has browser-polyfill.js file, and I'm trying to figure out how it can code
the code is like
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define("webextension-polyfill", ["module"], factory);
} else if (typeof exports !== "undefined") {
factory(module);
} else {
var mod = {
exports: {}
};
factory(mod);
global.browser = mod.exports;
}
})(this, function (module) {