chore: add webdriver-bidi-protocol types - #186
Conversation
| requestHeaders: this.parseHeaders(req.request?.headers || []), | ||
| resourceType: this.guessResourceType(req.request.url), | ||
| isXHR: | ||
| req.request.initiatorType === 'xmlhttprequest' || req.request.initiatorType === 'fetch', |
There was a problem hiding this comment.
I switched from req.initiator.type to req.request.initiatorType because only that property has the values xmlhttprequest and fetch and req.initiator.type is deprecated.
There was a problem hiding this comment.
ah good catch, thanks!
| "noImplicitOverride": true, | ||
| "useUnknownInCatchVariables": true | ||
| "useUnknownInCatchVariables": true, | ||
| "isolatedModules": true |
There was a problem hiding this comment.
We use vitest which uses esbuild and that always works as if isolatedModules was true. So I set it here to ensure that typescript warns us about any issues this may cause (like trying to access ambient const enums from webdriver-bidi-protocol).
| ? null | ||
| : behavior === 'allowed' | ||
| ? { type: 'allowed' } | ||
| ? ({ type: 'allowed' } as unknown as Browser.DownloadBehavior) |
There was a problem hiding this comment.
Nice find, the firefox implementation is wrong as well!
| requestHeaders: this.parseHeaders(req.request?.headers || []), | ||
| resourceType: this.guessResourceType(req.request.url), | ||
| isXHR: | ||
| req.request.initiatorType === 'xmlhttprequest' || req.request.initiatorType === 'fetch', |
There was a problem hiding this comment.
ah good catch, thanks!
| ? null | ||
| : behavior === 'allowed' | ||
| ? { type: 'allowed' } | ||
| ? ({ type: 'allowed' } as unknown as Browser.DownloadBehavior) |
There was a problem hiding this comment.
Nice find, the firefox implementation is wrong as well!
No description provided.