Update chrome.js

This commit is contained in:
Namhyeon Go 2024-01-08 01:41:35 +09:00 committed by GitHub
parent 6a0491c419
commit 04c2325ade
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1223,7 +1223,35 @@ var ChromeObject = function(interfaces) {
if (pos === 0)
return 'decodeURIComponent("' + value.substring(10) + '")';
else
return 'decodeURIComponent("' + encodeURIComponent(value) + '")';
return 'decodeURIComponent("' + this.encodeURIComponent(value)[0] + '")';
};
// Added in 2024-01-08
this.encodeURI = function(s) {
return [encodeURI(s), s];
};
// Added in 2024-01-08
this.decodeURI = function(s) {
if (s instanceof Array && s.length == 2) {
return s[1];
} else {
return decodeURI(s);
}
};
// Added in 2024-01-08
this.encodeURIComponent = function(s) {
return [encodeURIComponent(s), s];
};
// Added in 2024-01-08
this.decodeURIComponent = function(s) {
if (s instanceof Array && s.length == 2) {
return s[1];
} else {
return decodeURIComponent(s);
}
};
this.prompt = function(s) {