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

Enable compat with service workers and v3 extensions #1056

Merged
merged 1 commit into from
Nov 29, 2022

Conversation

waltjones
Copy link
Contributor

@waltjones waltjones commented Nov 29, 2022

Description of the change

This PR adds a fetch transport for sending Rollbar payloads. This enables compatibility with Service Workers, and with manifest v3 extensions which now use a Service Worker for the background script.

The PR introduces a new optional config option, defaultTransport. When set to "fetch" or "xhr", this transport will be used when available. The default when not set is "xhr". When only one transport is detected to be available, that one will be used regardless of the defaultTransport setting.

Since we have two transports now, these are moved into a /transport/ subdir. This causes a large block diff in the PR for the existing xhr transport code. None of that code has been changed, just moved to a new file.

Type of change

  • New feature (non-breaking change that adds functionality)

Related issues

  • Fix [SC-118535]

#1040

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers assigned
  • Issue from task tracker has a link to this pull request
  • Changes have been reviewed by at least one other engineer

@shortcut-integration
Copy link

@waltjones
Copy link
Contributor Author

CI failure is fixed in this PR and will be resolved when it merges. #1055

Copy link
Contributor

@mudetroit mudetroit left a comment

Choose a reason for hiding this comment

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

This looks good, at some point we should probably start the migration over to fetch in general, though this creates some fun with node. For now though this looks like a pretty direct change

@waltjones waltjones force-pushed the waltjones/118535/chrome-ext-manifest-v3 branch from aa62a9d to 85038b7 Compare November 29, 2022 19:47
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