* @param {string} key the preference key. * @param {(string|number|boolean)} value the preference value. * @return {!Options} A self reference. * @throws {TypeError} if either the key or value has an invalid type.
(key, value)
| 330 | * @throws {TypeError} if either the key or value has an invalid type. |
| 331 | */ |
| 332 | setPreference(key, value) { |
| 333 | if (typeof key !== 'string') { |
| 334 | throw TypeError(`key must be a string, but got ${typeof key}`) |
| 335 | } |
| 336 | if (typeof value !== 'string' && typeof value !== 'number' && typeof value !== 'boolean') { |
| 337 | throw TypeError(`value must be a string, number, or boolean, but got ${typeof value}`) |
| 338 | } |
| 339 | let options = this.firefoxOptions_() |
| 340 | options.prefs = options.prefs || {} |
| 341 | options.prefs[key] = value |
| 342 | return this |
| 343 | } |
| 344 | |
| 345 | /** |
| 346 | * Sets the path to an existing profile to use as a template for new browser |
no test coverage detected