PageSourceSearch

https://webdriver.io/assets/js/40d603b6.b7ae19cf.js

js webdriver.io collected 2026-09-24 08:35:52 UTC 2,908 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[34274],{8289:(e,i,s)=>{s.r(i),s.d(i,{assets:()=>r,contentTitle:()=>d,default:()=>m,frontMatter:()=>n,metadata:()=>t,toc:()=>l});const t=JSON.parse('{"id":"api/dialog/dismiss","title":"dismiss","description":"Dismisses the dialog and returns when the dialog has been handled.","source":"@site/docs/api/dialog/_dismiss.md","sourceDirName":"api/dialog","slug":"/api/dialog/dismiss","permalink":"/docs/api/dialog/dismiss","draft":false,"unlisted":false,"editUrl":"https://github.com/webdriverio/webdriverio/edit/main/packages/webdriverio/src/commands/dialog/dismiss.ts","tags":[],"version":"current","frontMatter":{"id":"dismiss","title":"dismiss","custom_edit_url":"https://github.com/webdriverio/webdriverio/edit/main/packages/webdriverio/src/commands/dialog/dismiss.ts"},"sidebar":"api","previous":{"title":"defaultValue","permalink":"/docs/api/dialog/defaultValue"},"next":{"title":"message","permalink":"/docs/api/dialog/message"}}');var a=s(86106),o=s(22002);const n={id:"dismiss",title:"dismiss",custom_edit_url:"https://github.com/webdriverio/webdriverio/edit/main/packages/webdriverio/src/commands/dialog/dismiss.ts"},d=void 0,r={},l=[{value:"Usage",id:"usage",level:2},{value:"Example",id:"example",level:2}];function c(e){const i={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.p,{children:"Dismisses the dialog and returns when the dialog has been handled."}),"\n",(0,a.jsx)(i.admonition,{type:"info",children:(0,a.jsxs)(i.p,{children:["Only works with browser dialogs (via BiDi protocol). For mobile native dialogs,\nuse ",(0,a.jsx)(i.a,{href:"/docs/api/mobile/dismissDialog",children:(0,a.jsx)(i.code,{children:"browser.dismissDialog"})})," instead."]})}),"\n",(0,a.jsx)(i.h2,{id:"usage",children:"Usage"}),"\n",(0,a.jsx)(i.pre,{children:(0,a.jsx)(i.code,{className:"language-js",children:"await dialog.dismiss()\n"})}),"\n",(0,a.jsx)(i.h2,{id:"example",children:"Example"}),"\n",(0,a.jsx)(i.pre,{children:(0,a.jsx)(i.code,{className:"language-js",metastring:'title="dialogDismiss.js"',children:"// Listen for the dialog event to get the dialog object\nbrowser.on('dialog', async (dialog) => {\n    console.log(dialog.message()); // prints: 'Are you sure?'\n    await dialog.dismiss();\n});\n"})})]})}function m(e={}){const{wrapper:i}={...(0,o.R)(),...e.components};return i?(0,a.jsx)(i,{...e,children:(0,a.jsx)(c,{...e})}):c(e)}},22002:(e,i,s)=>{s.d(i,{R:()=>n,x:()=>d});var t=s(7378);const a={},o=t.createContext(a);function n(e){const i=t.useContext(o);return t.useMemo(function(){return"function"==typeof e?e(i):{...i,...e}},[i,e])}function d(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:n(e.components),t.createElement(o.Provider,{value:i},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.