Open cyfung1031 opened 3 months ago
Is the code slow in LZString or is it slow in Greasemonkey? (reference code below)
Maybe when compressed data is passed to GM.setValue() it's triggering an anti-malware security check in Edge (assuming that's actually a thing). Someone will have to strip the code down to a much simpler test case to isolate the actual issue because there's a lot of moving parts.
async function setJV (key, text) {
if (typeof text === 'object') text = JSON.stringify(text)
if (typeof text !== 'string') return null
const z = LZString.compressToUTF16(text) // eslint-disable-line no-undef
return await custom.GM.setValue(key, z)
}
I wonder why this would become an Edge specific issue.
See https://github.com/cvzi/Spotify-Genius-Lyrics-userscript/issues/34 See https://github.com/cvzi/Youtube-Music-Genius-Lyrics-userscript/issues/18
Here is the userscripts zip file for your reproduction.
Userscripts.zip
Note: I cannot reproduce the issue from my side as I am using MacOS