MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / unpinScript

Method unpinScript

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

Source from the content-addressed store, hash-verified

1573 }
1574
1575 async unpinScript(script) {
1576 if (script && !(script instanceof PinnedScript)) {
1577 throw Error(`Pass valid PinnedScript object. Received: ${script}`)
1578 }
1579
1580 if (script.handle in this.pinnedScripts_) {
1581 let connection
1582 if (Object.is(this._cdpConnection, undefined)) {
1583 connection = this.createCDPConnection('page')
1584 } else {
1585 connection = this._cdpConnection
1586 }
1587
1588 await connection.send('Page.enable', {})
1589
1590 await connection.send('Runtime.evaluate', {
1591 expression: script.removalScript(),
1592 })
1593
1594 await connection.send('Page.removeScriptToEvaluateOnLoad', {
1595 identifier: script.scriptId,
1596 })
1597
1598 delete this.pinnedScripts_[script.handle]
1599 }
1600 }
1601
1602 /**
1603 *

Callers 1

devtools_test.jsFile · 0.80

Calls 5

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

Tested by

no test coverage detected