Skip to content

chore: add webdriver-bidi-protocol types - #186

Merged
juliandescottes merged 1 commit into
mozilla:mainfrom
hbenl:bidi-types
Sep 7, 2026
Merged

chore: add webdriver-bidi-protocol types#186
juliandescottes merged 1 commit into
mozilla:mainfrom
hbenl:bidi-types

Conversation

@hbenl

@hbenl hbenl commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

requestHeaders: this.parseHeaders(req.request?.headers || []),
resourceType: this.guessResourceType(req.request.url),
isXHR:
req.request.initiatorType === 'xmlhttprequest' || req.request.initiatorType === 'fetch',

@hbenl hbenl Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah good catch, thanks!

Comment thread tsconfig.json
"noImplicitOverride": true,
"useUnknownInCatchVariables": true
"useUnknownInCatchVariables": true,
"isolatedModules": true

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment thread src/firefox/index.ts
? null
: behavior === 'allowed'
? { type: 'allowed' }
? ({ type: 'allowed' } as unknown as Browser.DownloadBehavior)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find, the firefox implementation is wrong as well!

@juliandescottes juliandescottes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Holger!

requestHeaders: this.parseHeaders(req.request?.headers || []),
resourceType: this.guessResourceType(req.request.url),
isXHR:
req.request.initiatorType === 'xmlhttprequest' || req.request.initiatorType === 'fetch',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah good catch, thanks!

Comment thread src/firefox/index.ts
? null
: behavior === 'allowed'
? { type: 'allowed' }
? ({ type: 'allowed' } as unknown as Browser.DownloadBehavior)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find, the firefox implementation is wrong as well!

@juliandescottes
juliandescottes merged commit c7d7efa into mozilla:main Sep 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants