We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b3acf66 commit b483a76Copy full SHA for b483a76
src/js/utils/url.js
@@ -97,10 +97,12 @@ export const getAbsoluteURL = function(url) {
97
// Check if absolute URL
98
if (!url.match(/^https?:\/\//)) {
99
// Convert to absolute URL. Flash hosted off-site needs an absolute URL.
100
- const div = document.createElement('div');
+ // add the url to an anchor and let the browser parse the URL
101
+ const a = document.createElement('a');
102
- div.innerHTML = `<a href="${url}">x</a>`;
103
- url = div.firstChild.href;
+ a.href = url;
104
+
105
+ url = a.href;
106
}
107
108
return url;
0 commit comments