* 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)
| 767 | * @throws {error.InvalidArgumentError} |
| 768 | */ |
| 769 | function checkOptions(caps, key, optionType, setMethod) { |
| 770 | let val = caps.get(key) |
| 771 | if (val instanceof optionType) { |
| 772 | throw new error.InvalidArgumentError( |
| 773 | 'Options class extends Capabilities and should not be set as key ' + |
| 774 | `"${key}"; set browser-specific options with ` + |
| 775 | `Builder.${setMethod}(). For more information, see the ` + |
| 776 | 'documentation attached to the function that threw this error', |
| 777 | ) |
| 778 | } |
| 779 | } |
| 780 | |
| 781 | // PUBLIC API |
| 782 |