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

allow specification of WebUSB instance to support non-browser environments #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alangecker
Copy link

@alangecker alangecker commented Apr 13, 2023

Similar to your (@kdrag0n) webinstaller, I try to develop an more universal installer supporting a wider range of devices and other ROMS like Lineage.

for easier development (and some people would even prefer it) I first did a CLI variant using fastboot.js in node, which didn't work out of the box.

One obstacle is, that this project expects navigator.usb to be present, which makes it difficult to use WebUSB implementation in node like (e.g npm:usb)

Full node support still not given due to following other expectations, which are not handled in this PR:

  • Blob required
  • crypto required
  • ProgressEvent required
  • zip.js@2.2.27 doesn't support node

Copy link
Owner

@kdrag0n kdrag0n left a comment

Choose a reason for hiding this comment

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

It'd be better to add a FastbootOptions or DeviceOptions object for future-proofing.

{
  webusb: navigator.usb
}
this.usb = options?.webusb ?? navigator.usb

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.

None yet

2 participants