mirror of
https://github.com/videojs/video.js.git
synced 2025-03-19 21:28:23 +02:00
fix: don't add anchor to DOM for getAbsoluteURL (#7336)
This commit is contained in:
parent
b3acf66364
commit
b483a7613f
@ -97,10 +97,12 @@ export const getAbsoluteURL = function(url) {
|
||||
// Check if absolute URL
|
||||
if (!url.match(/^https?:\/\//)) {
|
||||
// Convert to absolute URL. Flash hosted off-site needs an absolute URL.
|
||||
const div = document.createElement('div');
|
||||
// add the url to an anchor and let the browser parse the URL
|
||||
const a = document.createElement('a');
|
||||
|
||||
div.innerHTML = `<a href="${url}">x</a>`;
|
||||
url = div.firstChild.href;
|
||||
a.href = url;
|
||||
|
||||
url = a.href;
|
||||
}
|
||||
|
||||
return url;
|
||||
|
Loading…
x
Reference in New Issue
Block a user