Skip to content

Commit

Permalink
Remove use of String.prototype.at
Browse files Browse the repository at this point in the history
This fixes an issue in Konqueror and Falkon, where `String.prototype.at`
is not defined.

Also: Update examples
  • Loading branch information
corrideat committed May 27, 2024
1 parent f38927e commit 06ba757
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@exact-realty/lot",
"version": "0.0.20",
"version": "0.0.21",
"description": "Sandbox for isolating ECMAScript code",
"main": "dist/index.cjs",
"types": "dist/index.d.cts",
Expand Down
6 changes: 4 additions & 2 deletions src/untrusted/lib/hardenGlobals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,15 @@ const disableURLStaticMethods = () => {
['writable']: true,
['enumerable']: true,
['configurable']: true,
['value']: String.bind(null),
['value']: function () {
return '';
}.bind(null),
},
['revokeObjectURL']: {
['writable']: true,
['enumerable']: true,
['configurable']: true,
['value']: String.prototype.at.bind(''),
['value']: function () {}.bind(null),
},
});
};
Expand Down

0 comments on commit 06ba757

Please sign in to comment.