[BUG] unescape() is deprecated
Closed this issue · 3 comments
bug
Unicode-encoded strings in params get mojibake.
code
chrome_parameters/src/popup.js
Line 270 in 73ea3cf
fix
It would be a solution to fix this by using decodeURIComponent
like this:
function decodeQueryParam(p) {
return decodeURIComponent(p.replace(/\+/g, ' '));
}
decodeQueryParam('search+query');
ref
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/unescape
Usually,
decodeURI
ordecodeURIComponent
are preferred overunescape
.
Note: Do not use
unescape
to decode URIs, usedecodeURI
instead.
Hi wintus,
thanks you for your bug and your suggestion, since you proposed already a solution, i htink it would be fair to you to open a PR and i will review and merge it in the coming days. But if you don't have time or don't want i'll test you suggested code and fix it in coupole of days.
Thanks again!
Sure, I'm gonna try to submit a PR on it in a upcoming week!