feat: add removeInsertedCSS (#16579)
This commit is contained in:
parent
deebde66f9
commit
5a08522b98
8 changed files with 88 additions and 9 deletions
|
@ -1010,6 +1010,21 @@ describe('<webview> tag', function () {
|
|||
})
|
||||
})
|
||||
|
||||
it('supports inserting CSS', async () => {
|
||||
await loadWebView(webview, { src: `file://${fixtures}/pages/base-page.html` })
|
||||
await webview.insertCSS('body { background-repeat: round; }')
|
||||
const result = await webview.executeJavaScript('window.getComputedStyle(document.body).getPropertyValue("background-repeat")')
|
||||
expect(result).to.equal('round')
|
||||
})
|
||||
|
||||
it('supports removing inserted CSS', async () => {
|
||||
await loadWebView(webview, { src: `file://${fixtures}/pages/base-page.html` })
|
||||
const key = await webview.insertCSS('body { background-repeat: round; }')
|
||||
await webview.removeInsertedCSS(key)
|
||||
const result = await webview.executeJavaScript('window.getComputedStyle(document.body).getPropertyValue("background-repeat")')
|
||||
expect(result).to.equal('repeat')
|
||||
})
|
||||
|
||||
describe('sendInputEvent', () => {
|
||||
it('can send keyboard event', async () => {
|
||||
loadWebView(webview, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue