-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: webExtension module #3012
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! Please add a couple of e2e tests, and it will be ready to merge:
Install + uninstall successfully.
Innstall invalid extension.
return { | ||
extension: response.id, | ||
}; | ||
} catch (err: any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} catch (err: any) { | |
} catch (err) { |
instead cast the (error as Error) for type-safety.
const response = await this.#browserCdpClient.sendCommand( | ||
'Extensions.loadUnpacked', | ||
{ | ||
path: (params.extensionData as WebExtension.ExtensionArchivePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for other types, we should throw an Unsupported exception as per spec https://w3c.github.io/webdriver-bidi/#expand-a-web-extension-data-spec
you can use a switch statement to cover all possible types of extensionData.
} from '../../../protocol/protocol.js'; | ||
|
||
/** | ||
* Responsible for handling the `storage` module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Responsible for handling the `storage` module. | |
* Responsible for handling the `webExtension` module. |
or delete the comment
* limitations under the License. | ||
*/ | ||
|
||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license is included twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! I left a few comments. Please add e2e tests as Maksim suggested. There are some WPT tests in progress in the Firefox repository so we do not need to add any for now.
PR implement webExtension module