Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
Override atob/btoa for spec-violating Electron.
Browse files Browse the repository at this point in the history
Fixes #291.
  • Loading branch information
TheGoddessInari committed Mar 1, 2022
1 parent 026a195 commit 2d8a4d1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions resources/js/hamsket-service-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,7 @@ Notification.permission = NativeNotification.permission;
Notification.requestPermission = NativeNotification.requestPermission.bind(Notification);

window.close = function() { location.href = location.origin; };

// Electron really screwed up here. atob and btoa are broken in recent versions, so override them.
window.atob = data => Buffer.from(data, "base64").toString("latin1");
window.btoa = data => Buffer.from(data, "latin1").toString("base64");

0 comments on commit 2d8a4d1

Please sign in to comment.