mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[GH-ISSUE #2140] [feature]: Would like access to btoa and atob functions from the pre-request script environment. #722
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#722
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @frenchtoastbeer on GitHub (Feb 28, 2022).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/2140
Is there an existing issue for this?
Summary
Like the title suggests, make base64 encoding and decoding available to the pre-request scripting environment.
Why should this be worked on?
I confess I am unaware if btoa is in the ecmascript standard or not, but seeing as how its been in every execution environment I ever tried to use it in, I was surprised when it wasn't available here.
@Chinoman10 commented on GitHub (Jan 19, 2024):
Been trying to use some combination of Buffer/CryptoJS, btoa and even seeing if it's somehow possible to import libraries into the pre-request scripts of Hoppscotch...
1h later I found this issue (Google has indeed been losing qualities...); sad that you can't do base64 encoding/decoding, but I'm happy there's a PR already made to add these functions in.
@marisly commented on GitHub (Mar 26, 2024):
Hello, thanks for developing the feature..
Could you please help with example of usage of a function?
WIll it be smth:
pw.env.set("btoa", btoa( "smth" ))
@liyasthomas commented on GitHub (May 1, 2024):
Thanks for your patience and valuable feedback. This feature has been implemented in a previous release candidate.
Closing this ticket as this feature is now available in the recent version. Please feel free to reach out if you have any other concerns.