Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

feat: webExtension module #3012

wants to merge 1 commit into from

Conversation

LiviuArln
Copy link
Collaborator

PR implement webExtension module

Copy link
Collaborator

@sadym-chromium sadym-chromium left a 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) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
} 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)
Copy link
Collaborator

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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* Responsible for handling the `storage` module.
* Responsible for handling the `webExtension` module.

or delete the comment

* limitations under the License.
*/

/*
Copy link
Collaborator

Choose a reason for hiding this comment

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

license is included twice.

Copy link
Collaborator

@OrKoN OrKoN left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants