mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Backport pull request #5558 from jellyfin-web/release-10.9.z
Fix `TypeError: Failed to construct 'Headers': No matching constructor signature.`
Original-merge: a806eeb3a7
Merged-by: thornbill <thornbill@users.noreply.github.com>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
parent
22eb6bf3f6
commit
94f34ddd13
2 changed files with 27 additions and 0 deletions
|
@ -34,6 +34,7 @@ import './legacy/domParserTextHtml';
|
||||||
import './legacy/focusPreventScroll';
|
import './legacy/focusPreventScroll';
|
||||||
import './legacy/htmlMediaElement';
|
import './legacy/htmlMediaElement';
|
||||||
import './legacy/keyboardEvent';
|
import './legacy/keyboardEvent';
|
||||||
|
import './legacy/patchHeaders';
|
||||||
import './legacy/vendorStyles';
|
import './legacy/vendorStyles';
|
||||||
import { currentSettings } from './scripts/settings/userSettings';
|
import { currentSettings } from './scripts/settings/userSettings';
|
||||||
import taskButton from './scripts/taskbutton';
|
import taskButton from './scripts/taskbutton';
|
||||||
|
|
26
src/legacy/patchHeaders.js
Normal file
26
src/legacy/patchHeaders.js
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
/**
|
||||||
|
* Patch 'Headers' to accept 'undefined'.
|
||||||
|
* Fixes `TypeError: Failed to construct 'Headers': No matching constructor signature.`
|
||||||
|
* Affected platforms:
|
||||||
|
* - Tizen 3
|
||||||
|
* - Tizen 4
|
||||||
|
* - webOS 4
|
||||||
|
*/
|
||||||
|
|
||||||
|
(function (window) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
if (window.Headers) {
|
||||||
|
try {
|
||||||
|
new window.Headers(undefined);
|
||||||
|
} catch (_) {
|
||||||
|
console.debug('patch \'Headers\' to accept \'undefined\'');
|
||||||
|
|
||||||
|
const _Headers = window.Headers;
|
||||||
|
|
||||||
|
window.Headers = function (init) {
|
||||||
|
return init ? new _Headers(init) : new _Headers();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}(window));
|
Loading…
Add table
Add a link
Reference in a new issue