MCPcopy
hub / github.com/SeleniumHQ/selenium / filterNonW3CCaps

Function filterNonW3CCaps

javascript/selenium-webdriver/lib/webdriver.js:643–652  ·  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

641 * capability names that are not valid W3C names.
642 */
643function filterNonW3CCaps(capabilities) {
644 let newCaps = new Capabilities(capabilities)
645 for (let k of newCaps.keys()) {
646 // Any key containing a colon is a vendor-prefixed capability.
647 if (!(W3C_CAPABILITY_NAMES.has(k) || k.indexOf(':') >= 0)) {
648 newCaps.delete(k)
649 }
650 }
651 return newCaps
652}
653
654/**
655 * 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