MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / filterNonW3CCaps

Function filterNonW3CCaps

javascript/selenium-webdriver/lib/webdriver.js:645–654  ·  view source on GitHub ↗

* @param {!Capabilities} capabilities A capabilities object. * @return {!Capabilities} A copy of the parameter capabilities, omitting * capability names that are not valid W3C names.

(capabilities)

Source from the content-addressed store, hash-verified

643 * capability names that are not valid W3C names.
644 */
645function filterNonW3CCaps(capabilities) {
646 let newCaps = new Capabilities(capabilities)
647 for (let k of newCaps.keys()) {
648 // Any key containing a colon is a vendor-prefixed capability.
649 if (!(W3C_CAPABILITY_NAMES.has(k) || k.indexOf(':') >= 0)) {
650 newCaps.delete(k)
651 }
652 }
653 return newCaps
654}
655
656/**
657 * Each WebDriver instance provides automated control over a browser session.

Callers 1

createSessionMethod · 0.85

Calls 3

keysMethod · 0.95
deleteMethod · 0.95
hasMethod · 0.45

Tested by

no test coverage detected