* In the 3.x releases, the various browser option classes * (e.g. firefox.Options) had to be manually set as an option using the * Capabilities class: * * let ffo = new firefox.Options(); * // Configure firefox options... * * let caps = new Capabilities(); * caps.set('moz:fir
(caps, key, optionType, setMethod)
| 754 | * @throws {error.InvalidArgumentError} |
| 755 | */ |
| 756 | function checkOptions(caps, key, optionType, setMethod) { |
| 757 | let val = caps.get(key) |
| 758 | if (val instanceof optionType) { |
| 759 | throw new error.InvalidArgumentError( |
| 760 | 'Options class extends Capabilities and should not be set as key ' + |
| 761 | `"${key}"; set browser-specific options with ` + |
| 762 | `Builder.${setMethod}(). For more information, see the ` + |
| 763 | 'documentation attached to the function that threw this error', |
| 764 | ) |
| 765 | } |
| 766 | } |
| 767 | |
| 768 | // PUBLIC API |
| 769 |