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

Method unpinScript

javascript/selenium-webdriver/lib/webdriver.js:1620–1645  ·  view source on GitHub ↗
(script)

Source from the content-addressed store, hash-verified

1618 }
1619
1620 async unpinScript(script) {
1621 if (script && !(script instanceof PinnedScript)) {
1622 throw Error(`Pass valid PinnedScript object. Received: ${script}`)
1623 }
1624
1625 if (script.handle in this.pinnedScripts_) {
1626 let connection
1627 if (Object.is(this._cdpConnection, undefined)) {
1628 connection = this.createCDPConnection('page')
1629 } else {
1630 connection = this._cdpConnection
1631 }
1632
1633 await connection.send('Page.enable', {})
1634
1635 await connection.send('Runtime.evaluate', {
1636 expression: script.removalScript(),
1637 })
1638
1639 await connection.send('Page.removeScriptToEvaluateOnLoad', {
1640 identifier: script.scriptId,
1641 })
1642
1643 delete this.pinnedScripts_[script.handle]
1644 }
1645 }
1646
1647 /**
1648 *

Callers 1

devtools_test.jsFile · 0.80

Calls 5

createCDPConnectionMethod · 0.95
isMethod · 0.65
sendMethod · 0.65
ErrorFunction · 0.50
removalScriptMethod · 0.45

Tested by

no test coverage detected