Add Polyfills for improved IE support

This commit is contained in:
ChunkyProgrammer 2023-12-19 18:27:09 -05:00
parent 5787c0b02f
commit 3b31d4881a
5 changed files with 52 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,23 @@
/*! (C) 2014 - 2015 Shinnosuke Watanabe - Mit Style License */
(function() {
'use strict';
var loc, value;
loc = window.location;
if (loc.origin) {
return;
}
value = loc.protocol + '//' + loc.hostname + (loc.port ? ':' + loc.port : '');
try {
Object.defineProperty(loc, 'origin', {
value: value,
enumerable: true
});
} catch (_error) {
loc.origin = value;
}
}).call(this);

View File

@ -11,6 +11,8 @@
<link rel="stylesheet" href="/css/default.css?v=<%= ASSET_COMMIT %>">
<link rel="stylesheet" href="/css/embed.css?v=<%= ASSET_COMMIT %>">
<title><%= HTML.escape(video.title) %> - Invidious</title>
<script src="/js/polyfills/UrlPolyfill.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/polyfills/locationOriginPolyfill.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/_helpers.js?v=<%= ASSET_COMMIT %>"></script>
</head>

View File

@ -302,6 +302,29 @@
<a href="/js/watch.js?v=<%= ASSET_COMMIT %>"><%= translate(locale, "source") %></a>
</td>
</tr>
<tr>
<td>
<a href="/js/polyfills/UrlPolyfill.js?v=<%= ASSET_COMMIT %>">UrlPolyfill.js</a>
</td>
<td>
<a href="https://choosealicense.com/licenses/mit">Expat</a>
</td>
<td>
<a href="https://github.com/lifaon74/url-polyfill"><%= translate(locale, "source") %></a>
</td>
</tr>
<tr>
<td>
<a href="/js/polyfills/locationOriginPolyfill.js?v=<%= ASSET_COMMIT %>">locationOriginPolyfill.js</a>
</td>
<td>
<a href="https://choosealicense.com/licenses/mit">Expat</a>
</td>
<td>
<a href="https://github.com/shinnn/location-origin.js"><%= translate(locale, "source") %></a>
</td>
</tr>
</table>
</body>
</html>

View File

@ -17,6 +17,8 @@
<link rel="stylesheet" href="/css/grids-responsive-min.css?v=<%= ASSET_COMMIT %>">
<link rel="stylesheet" href="/css/ionicons.min.css?v=<%= ASSET_COMMIT %>">
<link rel="stylesheet" href="/css/default.css?v=<%= ASSET_COMMIT %>">
<script src="/js/polyfills/UrlPolyfill.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/polyfills/locationOriginPolyfill.js?v=<%= ASSET_COMMIT %>"></script>
<script src="/js/_helpers.js?v=<%= ASSET_COMMIT %>"></script>
</head>