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