p5.js-web-editor
p5.js-web-editor copied to clipboard
Revoke outdated Blob URLs
Partial fix for #2234
This revokes the Blob URL which is assigned to the preview HTML document. I have not addressed the additional Blob URLs which are assigned to individual .js files as that's more complicated.
Changes:
EmbedFramecomponent stores its last-created Blob URL in a ref (srcRef).- It revokes the previous URL whenever it creates a new one.
- I put the revocation inside the existing
setTimeoutto be safe, so that there is no chance of seeing a momentary flash of expired content.
I have verified that this pull request:
- [x] has no linting errors (
npm run lint) - [x] has no test errors (
npm run test) - [x] is from a uniquely-named feature branch and is up to date with the
developbranch. - [x] is descriptively named and links to an issue number, i.e.
Fixes #123