Add encoding step when setting href

This commit is contained in:
starswolf 2021-09-22 17:25:00 +08:00 committed by GitHub
parent eeda86bd5e
commit 6231990c83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,8 +11,8 @@ export class CacheStorage {
return 'about:blank';
}
link.href = url;
link.href = link.href; // IE9, LOL! - http://jsfiddle.net/niklasvh/2e48b/
link.href = encodeURI(url);
link.href = encodeURI(link.href); // IE9, LOL! - http://jsfiddle.net/niklasvh/2e48b/
return link.protocol + link.hostname + link.port;
}