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

fix: remove window.Buffer assignment #214

Conversation

lenkan
Copy link
Collaborator

@lenkan lenkan commented Feb 14, 2024

Previously, we've had a polyfill setting window.Buffer = import("buffer").Buffer. However, window is not available in all environments (e.g. service workers). This causes background browser extension workers to either fail or require an extra polyfill.

This PR fixes that by removing the polyfill and importing the module where it is needed instead.

There should be a way to ensure that the typescript build or eslint check fails if we are using APIs that are not available in both browser and node.js environment, but I haven't been able to figure it out yet.

Copy link

codecov bot commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cedee3a) 82.86% compared to head (b9b1029) 82.86%.

Additional details and impacted files
@@             Coverage Diff              @@
##           development     #214   +/-   ##
============================================
  Coverage        82.86%   82.86%           
============================================
  Files               47       46    -1     
  Lines             4190     4190           
  Branches          1044     1044           
============================================
  Hits              3472     3472           
  Misses             689      689           
  Partials            29       29           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pfeairheller pfeairheller merged commit ec97594 into WebOfTrust:development Feb 14, 2024
8 checks passed
@lenkan lenkan deleted the fix-remove-window-buffer-assignment branch April 13, 2024 08:56
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