michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: 'use strict'; michael@0: michael@0: const { validateOptions } = require('../deprecated/api-utils'); michael@0: michael@0: function Options(options) { michael@0: if ('string' === typeof options) michael@0: options = { url: options }; michael@0: michael@0: return validateOptions(options, { michael@0: url: { is: ["string"] }, michael@0: inBackground: { michael@0: map: function(v) !!v, michael@0: is: ["undefined", "boolean"] michael@0: }, michael@0: isPinned: { is: ["undefined", "boolean"] }, michael@0: isPrivate: { is: ["undefined", "boolean"] }, michael@0: onOpen: { is: ["undefined", "function"] }, michael@0: onClose: { is: ["undefined", "function"] }, michael@0: onReady: { is: ["undefined", "function"] }, michael@0: onLoad: { is: ["undefined", "function"] }, michael@0: onPageShow: { is: ["undefined", "function"] }, michael@0: onActivate: { is: ["undefined", "function"] }, michael@0: onDeactivate: { is: ["undefined", "function"] } michael@0: }); michael@0: } michael@0: exports.Options = Options;